21 static int default_score = 99;
24 assert_score(
const char *score_s,
int expected_rc,
int expected_score)
32 assert_int_equal(rc, expected_rc);
33 assert_int_equal(score, expected_score);
38 invalid_args(
void **state)
53 null_score_string(
void **state)
59 default_score = -2000000;
62 default_score = 2000000;
69 null_score(
void **state)
88 bad_input(
void **state)
90 assert_score(
"redder", EINVAL, default_score);
96 special_values(
void **state)
120 outside_limits(
void **state)
136 inside_limits(
void **state)
143 cmocka_unit_test(invalid_args),
144 cmocka_unit_test(null_score_string),
145 cmocka_unit_test(null_score),
146 cmocka_unit_test(bad_input),
147 cmocka_unit_test(special_values),
148 cmocka_unit_test(outside_limits),
149 cmocka_unit_test(inside_limits))
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
void free_xml(xmlNode *child)
int pcmk__xe_get_score(const xmlNode *xml, const char *name, int *score, int default_score)
Pacemaker APIs related to scores.
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".