Expand data size utilities

This commit is contained in:
2025-12-24 08:53:12 +00:00
parent 3904b3a1ee
commit a065dfb573
12 changed files with 52 additions and 43 deletions

View File

@@ -77,7 +77,7 @@ TestFuncResult test_str8_buf(void) {
TestFuncResult test_str8_alloc_buf(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -105,7 +105,7 @@ TEST_ALLOC_BUF_CLEANUP:
TestFuncResult test_str8_alloc_cstr(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -126,7 +126,7 @@ TestFuncResult test_str8_alloc_cstr(void) {
TestFuncResult test_str8_alloc_str8(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -146,7 +146,7 @@ TestFuncResult test_str8_alloc_str8(void) {
TestFuncResult test_str8_alloc_substr(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -289,7 +289,7 @@ TestFuncResult test_str8_slice(void) {
TestFuncResult test_str8_alloc_concat(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("Hello world");
Str8 suffix1 = wapp_str8_lit(" from me.");
@@ -410,7 +410,7 @@ TestFuncResult test_str8_rfind(void) {
TestFuncResult test_str8_split(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");
@@ -467,7 +467,7 @@ TestFuncResult test_str8_split(void) {
TestFuncResult test_str8_split_with_max(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim = wapp_str8_lit(" ");
@@ -502,7 +502,7 @@ TestFuncResult test_str8_split_with_max(void) {
TestFuncResult test_str8_rsplit(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");
@@ -559,7 +559,7 @@ TestFuncResult test_str8_rsplit(void) {
TestFuncResult test_str8_rsplit_with_max(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim = wapp_str8_lit(" ");
@@ -594,7 +594,7 @@ TestFuncResult test_str8_rsplit_with_max(void) {
TestFuncResult test_str8_join(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");

View File

@@ -77,7 +77,7 @@ TestFuncResult test_str8_buf(void) {
TestFuncResult test_str8_alloc_buf(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -105,7 +105,7 @@ TestFuncResult test_str8_alloc_buf(void) {
TestFuncResult test_str8_alloc_cstr(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -126,7 +126,7 @@ TestFuncResult test_str8_alloc_cstr(void) {
TestFuncResult test_str8_alloc_str8(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -146,7 +146,7 @@ TestFuncResult test_str8_alloc_str8(void) {
TestFuncResult test_str8_alloc_substr(void) {
b8 result;
Allocator allocator = wapp_mem_arena_allocator_init(KB(100));
Allocator allocator = wapp_mem_arena_allocator_init(KiB(100));
if (wapp_mem_allocator_invalid(&allocator)) {
return wapp_tester_result(false);
}
@@ -289,7 +289,7 @@ TestFuncResult test_str8_slice(void) {
TestFuncResult test_str8_alloc_concat(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("Hello world");
Str8 suffix1 = wapp_str8_lit(" from me.");
@@ -410,7 +410,7 @@ TestFuncResult test_str8_rfind(void) {
TestFuncResult test_str8_split(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");
@@ -467,7 +467,7 @@ TestFuncResult test_str8_split(void) {
TestFuncResult test_str8_split_with_max(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim = wapp_str8_lit(" ");
@@ -502,7 +502,7 @@ TestFuncResult test_str8_split_with_max(void) {
TestFuncResult test_str8_rsplit(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");
@@ -559,7 +559,7 @@ TestFuncResult test_str8_rsplit(void) {
TestFuncResult test_str8_rsplit_with_max(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim = wapp_str8_lit(" ");
@@ -594,7 +594,7 @@ TestFuncResult test_str8_rsplit_with_max(void) {
TestFuncResult test_str8_join(void) {
b8 result;
Allocator arena = wapp_mem_arena_allocator_init(KB(100));
Allocator arena = wapp_mem_arena_allocator_init(KiB(100));
Str8 str = wapp_str8_lit("hello world from me");
Str8 delim1 = wapp_str8_lit(" ");