13 #include <libxml/tree.h> 21 #define DEFAULT_VALUE 0xfff 24 assert_flags(
const char *value,
int expected_rc,
unsigned int expected_flags)
39 assert_int_equal(rc, expected_rc);
40 assert_true(
flags == expected_flags);
46 null_name_invalid(
void **state)
61 assert_int_equal(rc, EINVAL);
66 assert_int_equal(rc, EINVAL);
73 null_xml_default(
void **state)
87 no_attr_default(
void **state)
93 invalid_attr_default(
void **state)
104 valid_attr(
void **state)
109 assert_flags(
"4294967295",
pcmk_rc_ok, 0xffffffff);
113 cmocka_unit_test(null_name_invalid),
114 cmocka_unit_test(null_xml_default),
115 cmocka_unit_test(no_attr_default),
116 cmocka_unit_test(invalid_attr_default),
117 cmocka_unit_test(valid_attr))
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int pcmk__xml_test_setup_group(void **state)
Wrappers for and extensions to libxml2.
void free_xml(xmlNode *child)
int pcmk__xml_test_teardown_group(void **state)
int pcmk__xe_get_flags(const xmlNode *xml, const char *name, uint32_t *dest, uint32_t default_value)
Retrieve a flag group from an XML attribute value.
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)