22 assert_comment(xmlDoc *doc,
const char *content)
32 assert_non_null(node);
33 assert_int_equal(node->type, XML_COMMENT_NODE);
34 assert_ptr_equal(node->doc, doc);
36 if (content == NULL) {
37 assert_null(node->content);
39 assert_non_null(node->content);
40 assert_string_equal((
const char *) node->content, content);
43 nodepriv = node->_private;
44 assert_non_null(nodepriv);
46 assert_true(pcmk_all_flags_set(nodepriv->
flags,
55 null_doc(
void **state)
62 with_doc(
void **state)
67 assert_non_null(doc->_private);
69 assert_comment(doc, NULL);
70 assert_comment(doc,
"some content");
76 cmocka_unit_test(null_doc),
77 cmocka_unit_test(with_doc));
void xml_track_changes(xmlNode *xml, const char *user, xmlNode *acl_source, bool enforce_acls)
G_GNUC_INTERNAL xmlDoc * pcmk__xml_new_doc(void)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
int pcmk__xml_test_setup_group(void **state)
#define pcmk__assert_asserts(stmt)
PCMK__UNIT_TEST(pcmk__xml_test_setup_group, pcmk__xml_test_teardown_group, cmocka_unit_test(null_doc), cmocka_unit_test(with_doc))
void free_xml(xmlNode *child)
int pcmk__xml_test_teardown_group(void **state)
#define PCMK__XML_NODE_PRIVATE_MAGIC
void pcmk__xml_free_doc(xmlDoc *doc)