From 20f9d23538811dde9ce8aea051408a05e178b6d4 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 25 Aug 2026 19:25:56 -0400 Subject: str: al_str_null() -> AL_STR_EMPTY Signed-off-by: Andrew Opalach --- tests/str.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/str.c') diff --git a/tests/str.c b/tests/str.c index 933b1f9..2b02297 100644 --- a/tests/str.c +++ b/tests/str.c @@ -47,10 +47,11 @@ static bool str_test_cat(void) str result = al_str_c("hygshiylitf"); - str string0; - al_str_from(&string0, "hyg"); + str string0 = AL_STR_EMPTY; + al_str_cat(&string0, &al_str_c("hyg")); AL_TEST_EQ(string0.length, 3, u32); + AL_TEST_GTE(string0.alloc, 3, u32); al_str_cat(&string0, &al_str_c("shiylitf")); @@ -167,7 +168,7 @@ static bool str_test_get_line(void) for (u32 i = 0; i < ARRAY_SIZE(strings); i++) { u32 counter = 0; - str line = al_str_null(); + str line = AL_STR_EMPTY; for (; al_str_get_line(&strings[i], '\n', &line); ) { AL_TEST_LT(counter, sizes[i], u32); AL_TEST_TRUE(al_str_eq(&line, &arrays[i][counter++])); @@ -176,7 +177,7 @@ static bool str_test_get_line(void) AL_TEST_EQ(counter, sizes[i], u32); counter = 0; - line = al_str_null(); + line = AL_STR_EMPTY; // One empty line. for (; al_str_get_line(&al_str_c("\n"), '\n', &line); ) { AL_TEST_LT(counter, 1, u32); @@ -185,7 +186,7 @@ static bool str_test_get_line(void) } // No lines. - line = al_str_null(); + line = AL_STR_EMPTY; AL_TEST_FALSE(al_str_get_line(&al_str_c(""), '\n', &line)); } @@ -337,7 +338,7 @@ static bool str_test_limits(void) { AL_TEST_START("str_limits"); - str s = al_str_null(); + str s = AL_STR_EMPTY; for (u32 i = 0; i < MAX_ALLOC_32 - 1; i++) { al_str_cat(&s, &al_str_c("y")); -- cgit v1.2.3-101-g0448