test: ds: update to use new object system

This commit is contained in:
2025-10-19 21:02:52 +01:00
parent 1daf31093c
commit 25dc4038df
6 changed files with 11 additions and 11 deletions

View File

@@ -15,6 +15,6 @@ int main(void)
printf("object %p\n", it.value); printf("object %p\n", it.value);
} }
b_array_release(array); b_array_unref(array);
return 0; return 0;
} }

View File

@@ -9,7 +9,7 @@ static void test_string_create(CuTest *tc)
CuAssertIntEquals(tc, 0, b_string_get_size(str, B_STRLEN_NORMAL)); CuAssertIntEquals(tc, 0, b_string_get_size(str, B_STRLEN_NORMAL));
CuAssertStrEquals(tc, "", b_string_ptr(str)); CuAssertStrEquals(tc, "", b_string_ptr(str));
b_string_release(str); b_string_unref(str);
str = b_string_create_from_c('A', 8); str = b_string_create_from_c('A', 8);
@@ -17,7 +17,7 @@ static void test_string_create(CuTest *tc)
CuAssertIntEquals(tc, 8, b_string_get_size(str, B_STRLEN_NORMAL)); CuAssertIntEquals(tc, 8, b_string_get_size(str, B_STRLEN_NORMAL));
CuAssertStrEquals(tc, "AAAAAAAA", b_string_ptr(str)); CuAssertStrEquals(tc, "AAAAAAAA", b_string_ptr(str));
b_string_release(str); b_string_unref(str);
str = b_string_create_from_cstr("Hello, world!"); str = b_string_create_from_cstr("Hello, world!");
@@ -25,7 +25,7 @@ static void test_string_create(CuTest *tc)
CuAssertIntEquals(tc, 13, b_string_get_size(str, B_STRLEN_NORMAL)); CuAssertIntEquals(tc, 13, b_string_get_size(str, B_STRLEN_NORMAL));
CuAssertStrEquals(tc, "Hello, world!", b_string_ptr(str)); CuAssertStrEquals(tc, "Hello, world!", b_string_ptr(str));
b_string_release(str); b_string_unref(str);
} }
static void test_string_length(CuTest *tc) static void test_string_length(CuTest *tc)
@@ -36,7 +36,7 @@ static void test_string_length(CuTest *tc)
CuAssertIntEquals(tc, 13, b_string_get_size(s, B_STRLEN_IGNORE_ESC)); CuAssertIntEquals(tc, 13, b_string_get_size(s, B_STRLEN_IGNORE_ESC));
CuAssertIntEquals(tc, 20, b_string_get_size(s, B_STRLEN_NORMAL)); CuAssertIntEquals(tc, 20, b_string_get_size(s, B_STRLEN_NORMAL));
b_string_release(s); b_string_unref(s);
} }
CuSuite *get_all_tests(void) CuSuite *get_all_tests(void)

View File

@@ -6,6 +6,6 @@ int main(void)
b_number *number = b_number_create_float(6.8); b_number *number = b_number_create_float(6.8);
printf("number=%zd\n", B_NUMBER_IVAL(number)); printf("number=%zd\n", B_NUMBER_IVAL(number));
b_number_release(number); b_number_unref(number);
return 0; return 0;
} }

View File

@@ -26,7 +26,7 @@ int main(void)
b_string_get_capacity(str)); b_string_get_capacity(str));
printf("-------------\n"); printf("-------------\n");
b_string_release(str); b_string_unref(str);
b_stringstream strv; b_stringstream strv;
b_stringstream_begin_dynamic(&strv); b_stringstream_begin_dynamic(&strv);

View File

@@ -33,7 +33,7 @@ int main(void)
b_dict_foreach(&it, dict) b_dict_foreach(&it, dict)
{ {
printf("item %zu: %s=%d\n", it.i, b_string_ptr(it.key), printf("item %zu: %s=%d\n", it.i, b_string_ptr(it.key),
b_number_get_int(B_NUMBER(it.value))); b_number_get_int(it.value));
} }
b_tree *tree = b_tree_create(); b_tree *tree = b_tree_create();
@@ -112,8 +112,8 @@ int main(void)
printf("%d\n", item->value); printf("%d\n", item->value);
} }
b_tree_release(tree); b_tree_unref(tree);
b_dict_release(dict); b_dict_unref(dict);
return 0; return 0;
} }

View File

@@ -9,6 +9,6 @@ int main(void)
b_uuid_to_cstr(uuid, str); b_uuid_to_cstr(uuid, str);
printf("%s\n", str); printf("%s\n", str);
b_uuid_release(uuid); b_uuid_unref(uuid);
return 0; return 0;
} }