17 null_args(
void **state)
25 g_hash_table_destroy(tbl);
29 missing_key(
void **state)
35 assert_int_equal(
result, 123);
37 g_hash_table_destroy(tbl);
41 standard_usage(
void **state)
46 g_hash_table_insert(tbl, strdup(
"abc"), strdup(
"123"));
49 assert_int_equal(
result, 123);
51 g_hash_table_destroy(tbl);
55 conversion_errors(
void **state)
60 g_hash_table_insert(tbl, strdup(
"negative"), strdup(
"-3"));
61 g_hash_table_insert(tbl, strdup(
"toobig"), strdup(
"20000000000000000"));
62 g_hash_table_insert(tbl, strdup(
"baddata"), strdup(
"asdf"));
65 assert_int_equal(
result, 456);
68 assert_int_equal(
result, 456);
71 assert_int_equal(
result, 456);
73 g_hash_table_destroy(tbl);
77 cmocka_unit_test(null_args),
78 cmocka_unit_test(missing_key),
79 cmocka_unit_test(standard_usage),
80 cmocka_unit_test(conversion_errors))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
int pcmk__guint_from_hash(GHashTable *table, const char *key, guint default_val, guint *result)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
pcmk__action_result_t result