18 #define LOCAL_BUF_SIZE 2 * DBL_MAX_10_EXP 24 #if HAVE_DECL_ASSERT_FLOAT_EQUAL == 0 25 #define assert_float_equal(a, b, epsilon) assert_true(fabs((a) - (b)) < (epsilon)) 29 empty_input_string(
void **state)
49 bad_input_string(
void **state)
69 trailing_chars(
void **state)
76 assert_string_equal(end_text,
"asdf");
80 no_result_variable(
void **state)
86 typical_case(
void **state)
110 double_overflow(
void **state)
121 assert_true(
result > DBL_MAX);
125 assert_true(
result < -DBL_MAX);
129 double_underflow(
void **state)
142 assert_true(
result >= 0.0);
143 assert_true(
result <= DBL_MIN);
147 assert_true(
result <= 0.0);
148 assert_true(
result >= -DBL_MIN);
152 cmocka_unit_test(empty_input_string),
153 cmocka_unit_test(bad_input_string),
154 cmocka_unit_test(trailing_chars),
155 cmocka_unit_test(no_result_variable),
156 cmocka_unit_test(typical_case),
157 cmocka_unit_test(double_overflow),
158 cmocka_unit_test(double_underflow))
#define assert_float_equal(a, b, epsilon)
#define PCMK__PARSE_DBL_DEFAULT
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
#define pcmk__assert_asserts(stmt)
int pcmk__scan_double(const char *text, double *result, const char *default_text, char **end_text)
pcmk__action_result_t result