13 #include <libxml/tree.h> 21 #define REFERENCE_ISO8601 "2024-001" 22 #define ATTR_PRESENT "start" 23 #define ATTR_MISSING "end" 24 #define REFERENCE_XML "<date_expression id=\"id1\" " \ 25 ATTR_PRESENT "=\"" REFERENCE_ISO8601 "\"" \ 27 #define BAD_XML "<date_expression id=\"id1\" " \ 28 ATTR_PRESENT "=\"not_a_time\"" \ 32 null_invalid(
void **state)
52 nonnull_time_invalid(
void **state)
64 attr_missing(
void **state)
76 attr_valid(
void **state)
91 attr_invalid(
void **state)
104 cmocka_unit_test(null_invalid),
105 cmocka_unit_test(nonnull_time_invalid),
106 cmocka_unit_test(attr_missing),
107 cmocka_unit_test(attr_valid),
108 cmocka_unit_test(attr_invalid))
crm_time_t * crm_time_new_undefined(void)
Allocate memory for an uninitialized time object.
int pcmk__xe_get_datetime(const xmlNode *xml, const char *attr, crm_time_t **t)
struct crm_time_s crm_time_t
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
int pcmk__xml_test_setup_group(void **state)
Wrappers for and extensions to libxml2.
void free_xml(xmlNode *child)
#define REFERENCE_ISO8601
int pcmk__xml_test_teardown_group(void **state)
xmlNode * pcmk__xml_parse(const char *input)
int crm_time_compare(const crm_time_t *a, const crm_time_t *b)
crm_time_t * crm_time_new(const char *string)
void crm_time_free(crm_time_t *dt)