22 #define LOCAL_BUF_SIZE 2 * DBL_MAX_10_EXP 28 #if HAVE_DECL_ASSERT_FLOAT_EQUAL == 0 29 #define assert_float_equal(a, b, epsilon) assert_true(fabs((a) - (b)) < (epsilon)) 33 empty_input_string(
void **state)
53 bad_input_string(
void **state)
73 trailing_chars(
void **state)
80 assert_string_equal(end_text,
"asdf");
84 typical_case(
void **state)
108 double_overflow(
void **state)
119 assert_true(
result > DBL_MAX);
123 assert_true(
result < -DBL_MAX);
127 double_underflow(
void **state)
140 assert_true(
result >= 0.0);
141 assert_true(
result <= DBL_MIN);
145 assert_true(
result <= 0.0);
146 assert_true(
result >= -DBL_MIN);
149 int main(
int argc,
char **argv)
151 const struct CMUnitTest tests[] = {
153 cmocka_unit_test(empty_input_string),
154 cmocka_unit_test(bad_input_string),
155 cmocka_unit_test(trailing_chars),
158 cmocka_unit_test(typical_case),
159 cmocka_unit_test(double_overflow),
160 cmocka_unit_test(double_underflow),
163 cmocka_set_message_output(CM_OUTPUT_TAP);
164 return cmocka_run_group_tests(tests, NULL, NULL);
#define assert_float_equal(a, b, epsilon)
#define PCMK__PARSE_DBL_DEFAULT
int main(int argc, char **argv)
int pcmk__scan_double(const char *text, double *result, const char *default_text, char **end_text)
pcmk__action_result_t result