20 setenv(
"PCMK_schema_directory", PCMK__TEST_SCHEMA_DIR, 1);
26 teardown(
void **state)
29 unsetenv(
"PCMK_schema_directory");
34 assert_schema(
const char *
name,
int expected_index)
36 GList *schema_entry = NULL;
40 assert_non_null(schema_entry);
42 schema = schema_entry->data;
43 assert_non_null(schema);
49 unknown_schema(
void **state)
58 known_schema(
void **state)
61 assert_schema(NULL, 16);
63 assert_schema(
"pacemaker-1.0", 0);
64 assert_schema(
"pacemaker-1.2", 1);
65 assert_schema(
"pacemaker-2.0", 3);
66 assert_schema(
"pacemaker-2.5", 8);
67 assert_schema(
"pacemaker-3.0", 14);
71 case_insensitive(
void **state)
73 assert_schema(
"PACEMAKER-1.0", 0);
74 assert_schema(
"pAcEmAkEr-2.0", 3);
75 assert_schema(
"paceMAKER-3.0", 14);
79 cmocka_unit_test(unknown_schema),
80 cmocka_unit_test(known_schema),
81 cmocka_unit_test(case_insensitive));
void crm_schema_init(void)
void crm_schema_cleanup(void)
GList * pcmk__get_schema(const char *name)
Wrappers for and extensions to libxml2.
PCMK__UNIT_TEST(setup, teardown, cmocka_unit_test(unknown_schema), cmocka_unit_test(known_schema), cmocka_unit_test(case_insensitive))