Update C++ API

This commit is contained in:
2025-12-14 23:46:28 +00:00
parent dcadacdf2b
commit a2f42c135f
4 changed files with 104 additions and 109 deletions

View File

@@ -10,16 +10,16 @@ TestFuncResult test_str8_array(void) {
Str8 str1 = wapp_str8_lit("Hello");
Str8 str2 = wapp_str8_lit("Hi");
Str8 str3 = wapp_str8_lit("Bye");
Str8 *array = wapp_array(Str8, str1, str2, str3);
Str8Array array = wapp_array(Str8, Str8Array, str1, str2, str3);
result = wapp_array_count(array) == 3 && wapp_array_capacity(array) == 8;
result = array.count == 3 && array.capacity == 8;
Str8 *item;
u64 count = wapp_array_count(array);
u64 count = array.count;
u64 index = 0;
b8 running = true;
while (running) {
item = wapp_array_get(Str8, array, index);
item = wapp_array_get(Str8, &array, index);
result = result && item && (wapp_str8_equal(item, &expected[index]));
++index;