12 #include <libxml/tree.h> 19 #include "../../crmcommon_private.h" 21 #define ALL_VALID "<duration id=\"duration1\" years=\"1\" months=\"2\" " \ 22 "weeks=\"3\" days=\"-1\" hours=\"1\" minutes=\"1\" " \ 25 #define YEARS_INVALID "<duration id=\"duration1\" years=\"not-a-number\" />" 27 #define YEARS_TOO_BIG "<duration id=\"duration1\" years=\"2222222222\" />" 29 #define YEARS_TOO_SMALL "<duration id=\"duration1\" years=\"-2222222222\" />" 32 null_time_invalid(
void **state)
42 null_xml_ok(
void **state)
56 invalid_component(
void **state)
66 missing_attr(
void **state)
82 invalid_attr(
void **state)
98 out_of_range_attr(
void **state)
119 add_years(
void **state)
135 add_months(
void **state)
151 add_weeks(
void **state)
167 add_days(
void **state)
183 add_hours(
void **state)
199 add_minutes(
void **state)
215 add_seconds(
void **state)
231 cmocka_unit_test(null_time_invalid),
232 cmocka_unit_test(null_xml_ok),
233 cmocka_unit_test(invalid_component),
234 cmocka_unit_test(missing_attr),
235 cmocka_unit_test(invalid_attr),
236 cmocka_unit_test(out_of_range_attr),
237 cmocka_unit_test(add_years),
238 cmocka_unit_test(add_months),
239 cmocka_unit_test(add_weeks),
240 cmocka_unit_test(add_days),
241 cmocka_unit_test(add_hours),
242 cmocka_unit_test(add_minutes),
243 cmocka_unit_test(add_seconds));
struct crm_time_s crm_time_t
PCMK__UNIT_TEST(pcmk__xml_test_setup_group, pcmk__xml_test_teardown_group, cmocka_unit_test(null_time_invalid), cmocka_unit_test(null_xml_ok), cmocka_unit_test(invalid_component), cmocka_unit_test(missing_attr), cmocka_unit_test(invalid_attr), cmocka_unit_test(out_of_range_attr), cmocka_unit_test(add_years), cmocka_unit_test(add_months), cmocka_unit_test(add_weeks), cmocka_unit_test(add_days), cmocka_unit_test(add_hours), cmocka_unit_test(add_minutes), cmocka_unit_test(add_seconds))
crm_time_t * pcmk_copy_time(const crm_time_t *source)
G_GNUC_INTERNAL int pcmk__add_time_from_xml(crm_time_t *t, enum pcmk__time_component component, const xmlNode *xml)
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)
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)