17 store_strs(
void **state)
19 GHashTable *tbl = NULL;
24 assert_true(g_hash_table_insert(tbl, strdup(
"key-abc"), strdup(
"val-abc")));
25 assert_int_equal(g_hash_table_size(tbl), 1);
26 assert_string_equal(g_hash_table_lookup(tbl,
"key-abc"),
"val-abc");
28 assert_false(g_hash_table_insert(tbl, strdup(
"key-abc"), strdup(
"val-def")));
29 assert_int_equal(g_hash_table_size(tbl), 1);
30 assert_string_equal(g_hash_table_lookup(tbl,
"key-abc"),
"val-def");
32 assert_false(g_hash_table_insert(tbl, strdup(
"key-ABC"), strdup(
"val-ABC")));
33 assert_int_equal(g_hash_table_size(tbl), 1);
34 assert_string_equal(g_hash_table_lookup(tbl,
"key-ABC"),
"val-ABC");
36 g_hash_table_destroy(tbl);
40 cmocka_unit_test(store_strs))
PCMK__UNIT_TEST(NULL, NULL, cmocka_unit_test(bad_input), cmocka_unit_test(not_found), cmocka_unit_test(find_attrB), cmocka_unit_test(find_attrA_matching))
GHashTable * pcmk__strikey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)