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)
82 typical_case(
void **state)
106 double_overflow(
void **state)
117 assert_true(result > DBL_MAX);
121 assert_true(result < -DBL_MAX);
125 double_underflow(
void **state)
138 assert_true(result >= 0.0);
139 assert_true(result <= DBL_MIN);
143 assert_true(result <= 0.0);
144 assert_true(result >= -DBL_MIN);
147 int main(
int argc,
char **argv)
149 const struct CMUnitTest tests[] = {
151 cmocka_unit_test(empty_input_string),
152 cmocka_unit_test(bad_input_string),
153 cmocka_unit_test(trailing_chars),
156 cmocka_unit_test(typical_case),
157 cmocka_unit_test(double_overflow),
158 cmocka_unit_test(double_underflow),
161 cmocka_set_message_output(CM_OUTPUT_TAP);
162 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)