20 setenv(
"PCMK_schema_directory", PCMK__TEST_SCHEMA_DIR, 1);
26 teardown(
void **state)
29 unsetenv(
"PCMK_schema_directory");
34 invalid_name(
void **state)
41 valid_name(
void **state)
43 GList *schemas = NULL;
46 assert_int_equal(g_list_length(schemas), 18);
48 assert_string_equal(
"pacemaker-1.2.rng", g_list_nth_data(schemas, 0));
49 assert_string_equal(
"upgrade-1.3.xsl", g_list_nth_data(schemas, 1));
50 assert_string_equal(
"pacemaker-1.3.rng", g_list_nth_data(schemas, 2));
51 assert_string_equal(
"pacemaker-2.0.rng", g_list_nth_data(schemas, 3));
52 assert_string_equal(
"pacemaker-2.1.rng", g_list_nth_data(schemas, 4));
53 assert_string_equal(
"pacemaker-2.2.rng", g_list_nth_data(schemas, 5));
54 assert_string_equal(
"pacemaker-2.3.rng", g_list_nth_data(schemas, 6));
55 assert_string_equal(
"pacemaker-2.4.rng", g_list_nth_data(schemas, 7));
56 assert_string_equal(
"pacemaker-2.5.rng", g_list_nth_data(schemas, 8));
57 assert_string_equal(
"pacemaker-2.6.rng", g_list_nth_data(schemas, 9));
58 assert_string_equal(
"pacemaker-2.7.rng", g_list_nth_data(schemas, 10));
59 assert_string_equal(
"pacemaker-2.8.rng", g_list_nth_data(schemas, 11));
60 assert_string_equal(
"pacemaker-2.9.rng", g_list_nth_data(schemas, 12));
61 assert_string_equal(
"upgrade-2.10-leave.xsl", g_list_nth_data(schemas, 13));
62 assert_string_equal(
"upgrade-2.10-enter.xsl", g_list_nth_data(schemas, 14));
63 assert_string_equal(
"upgrade-2.10.xsl", g_list_nth_data(schemas, 15));
64 assert_string_equal(
"pacemaker-2.10.rng", g_list_nth_data(schemas, 16));
65 assert_string_equal(
"pacemaker-3.0.rng", g_list_nth_data(schemas, 17));
66 g_list_free_full(schemas, free);
70 assert_int_equal(g_list_length(schemas), 14);
71 assert_string_equal(
"pacemaker-2.1.rng", g_list_nth_data(schemas, 0));
72 assert_string_equal(
"pacemaker-2.2.rng", g_list_nth_data(schemas, 1));
73 assert_string_equal(
"pacemaker-2.3.rng", g_list_nth_data(schemas, 2));
74 assert_string_equal(
"pacemaker-2.4.rng", g_list_nth_data(schemas, 3));
75 assert_string_equal(
"pacemaker-2.5.rng", g_list_nth_data(schemas, 4));
76 assert_string_equal(
"pacemaker-2.6.rng", g_list_nth_data(schemas, 5));
77 assert_string_equal(
"pacemaker-2.7.rng", g_list_nth_data(schemas, 6));
78 assert_string_equal(
"pacemaker-2.8.rng", g_list_nth_data(schemas, 7));
79 assert_string_equal(
"pacemaker-2.9.rng", g_list_nth_data(schemas, 8));
80 assert_string_equal(
"upgrade-2.10-leave.xsl", g_list_nth_data(schemas, 9));
81 assert_string_equal(
"upgrade-2.10-enter.xsl", g_list_nth_data(schemas, 10));
82 assert_string_equal(
"upgrade-2.10.xsl", g_list_nth_data(schemas, 11));
83 assert_string_equal(
"pacemaker-2.10.rng", g_list_nth_data(schemas, 12));
84 assert_string_equal(
"pacemaker-3.0.rng", g_list_nth_data(schemas, 13));
85 g_list_free_full(schemas, free);
89 assert_int_equal(g_list_length(schemas), 5);
90 assert_string_equal(
"upgrade-2.10-leave.xsl", g_list_nth_data(schemas, 0));
91 assert_string_equal(
"upgrade-2.10-enter.xsl", g_list_nth_data(schemas, 1));
92 assert_string_equal(
"upgrade-2.10.xsl", g_list_nth_data(schemas, 2));
93 assert_string_equal(
"pacemaker-2.10.rng", g_list_nth_data(schemas, 3));
94 assert_string_equal(
"pacemaker-3.0.rng", g_list_nth_data(schemas, 4));
95 g_list_free_full(schemas, free);
101 assert_null(schemas);
105 cmocka_unit_test(invalid_name),
106 cmocka_unit_test(valid_name))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
void crm_schema_init(void)
void crm_schema_cleanup(void)
GList * pcmk__schema_files_later_than(const char *name)