Switch to using b32

This commit is contained in:
Abdelrahman Said
2025-09-14 21:25:56 +01:00
parent b4eb8d2760
commit b7eff6a3e4
31 changed files with 227 additions and 249 deletions

View File

@@ -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 = nullptr;
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 = nullptr;
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 = (i32 *)wapp_mem_arena_alloc(arena, count * sizeof(i32));
bool result = array != nullptr;
b32 result = array != nullptr;
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 = (u8 *)wapp_mem_arena_alloc(arena, ARENA_CAPACITY * 2);
bool result = bytes == nullptr;
b32 result = bytes == nullptr;
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 == nullptr;
b32 result = arena == nullptr;
return wapp_tester_result(result);
}