Switch to using b32
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "test_arena.h"
|
||||
#include "wapp.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ARENA_CAPACITY KB(16)
|
||||
@@ -10,7 +9,7 @@ internal i32 count = 20;
|
||||
internal i32 *array = NULL;
|
||||
|
||||
TestFuncResult test_arena_init(void) {
|
||||
bool result = wapp_mem_arena_init(&arena, ARENA_CAPACITY);
|
||||
b32 result = wapp_mem_arena_init(&arena, ARENA_CAPACITY);
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
@@ -18,7 +17,7 @@ TestFuncResult test_arena_init(void) {
|
||||
TestFuncResult test_arena_init_succeeds_when_reserving_very_large_size(void) {
|
||||
Arena *large_arena = NULL;
|
||||
u64 capacity = GB(512);
|
||||
bool result = wapp_mem_arena_init(&large_arena, capacity);
|
||||
b32 result = wapp_mem_arena_init(&large_arena, capacity);
|
||||
if (result) {
|
||||
wapp_mem_arena_destroy(&large_arena);
|
||||
}
|
||||
@@ -28,7 +27,7 @@ TestFuncResult test_arena_init_succeeds_when_reserving_very_large_size(void) {
|
||||
|
||||
TestFuncResult test_arena_alloc_succeeds_when_within_capacity(void) {
|
||||
array = wapp_mem_arena_alloc(arena, count * sizeof(i32));
|
||||
bool result = array != NULL;
|
||||
b32 result = array != NULL;
|
||||
|
||||
for (i32 i = 0; i < count; ++i) {
|
||||
array[i] = i * 10;
|
||||
@@ -39,7 +38,7 @@ TestFuncResult test_arena_alloc_succeeds_when_within_capacity(void) {
|
||||
|
||||
TestFuncResult test_arena_alloc_fails_when_over_capacity(void) {
|
||||
u8 *bytes = wapp_mem_arena_alloc(arena, ARENA_CAPACITY * 2);
|
||||
bool result = bytes == NULL;
|
||||
b32 result = bytes == NULL;
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
@@ -92,7 +91,7 @@ TestFuncResult test_arena_realloc_smaller_size(void) {
|
||||
|
||||
TestFuncResult test_arena_clear(void) {
|
||||
wapp_mem_arena_clear(arena);
|
||||
bool result = true;
|
||||
b32 result = true;
|
||||
|
||||
for (i32 i = 0; i < count; ++i) {
|
||||
if (array[i] != 0) {
|
||||
@@ -106,7 +105,7 @@ TestFuncResult test_arena_clear(void) {
|
||||
|
||||
TestFuncResult test_arena_destroy(void) {
|
||||
wapp_mem_arena_destroy(&arena);
|
||||
bool result = arena == NULL;
|
||||
b32 result = arena == NULL;
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user