summaryrefslogtreecommitdiff
path: root/tests/str.c
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-08-25 19:25:56 -0400
committerAndrew Opalach <andrew@akon.city> 2026-08-25 19:25:56 -0400
commit20f9d23538811dde9ce8aea051408a05e178b6d4 (patch)
treed2afbc45345dad0d6c0a5456c4e6f2bc87d9202f /tests/str.c
parentf6d6c613bf6d770a148e30afa4b94fd163e96d6a (diff)
downloadlibalabaster-20f9d23538811dde9ce8aea051408a05e178b6d4.tar.gz
libalabaster-20f9d23538811dde9ce8aea051408a05e178b6d4.tar.bz2
libalabaster-20f9d23538811dde9ce8aea051408a05e178b6d4.zip
str: al_str_null() -> AL_STR_EMPTY
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'tests/str.c')
-rw-r--r--tests/str.c13
1 files changed, 7 insertions, 6 deletions
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"));