17 null_input_table(
void **state)
23 empty_input_table(
void **state)
26 GHashTable *copy = NULL;
29 assert_int_equal(g_hash_table_size(copy), 0);
31 g_hash_table_destroy(tbl);
32 g_hash_table_destroy(copy);
36 regular_input_table(
void **state)
39 GHashTable *copy = NULL;
41 g_hash_table_insert(tbl, strdup(
"abc"), strdup(
"123"));
42 g_hash_table_insert(tbl, strdup(
"def"), strdup(
"456"));
43 g_hash_table_insert(tbl, strdup(
"ghi"), strdup(
"789"));
46 assert_int_equal(g_hash_table_size(copy), 3);
48 assert_string_equal(g_hash_table_lookup(tbl,
"abc"),
"123");
49 assert_string_equal(g_hash_table_lookup(tbl,
"def"),
"456");
50 assert_string_equal(g_hash_table_lookup(tbl,
"ghi"),
"789");
52 g_hash_table_destroy(tbl);
53 g_hash_table_destroy(copy);
57 cmocka_unit_test(null_input_table),
58 cmocka_unit_test(empty_input_table),
59 cmocka_unit_test(regular_input_table))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
GHashTable * pcmk__str_table_dup(GHashTable *old_table)