21 static int default_score = 99;
24 assert_score(
const char *score_s,
int expected_rc,
int expected_score)
29 assert_int_equal(rc, expected_rc);
30 assert_int_equal(score, expected_score);
34 null_score_string(
void **state)
40 default_score = -2000000;
43 default_score = 2000000;
50 null_score(
void **state)
59 bad_input(
void **state)
61 assert_score(
"redder", EINVAL, default_score);
67 special_values(
void **state)
91 outside_limits(
void **state)
108 inside_limits(
void **state)
115 cmocka_unit_test(null_score_string),
116 cmocka_unit_test(null_score),
117 cmocka_unit_test(bad_input),
118 cmocka_unit_test(special_values),
119 cmocka_unit_test(outside_limits),
120 cmocka_unit_test(inside_limits))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int pcmk_parse_score(const char *score_s, int *score, int default_score)
Parse an integer score from a string.
Pacemaker APIs related to scores.
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".