17 #define LOCAL_BUF_SIZE 2 * DBL_MAX_10_EXP
23 #define ASSERT_DBL_EQ(d1, d2) g_assert_cmpfloat(fabs(d1 - d2), \
27 empty_input_string(
void)
48 bad_input_string(
void)
110 double_overflow(
void)
121 g_assert_cmpfloat(result, >, DBL_MAX);
125 g_assert_cmpfloat(result, <, -DBL_MAX);
129 double_underflow(
void)
143 g_assert_cmpfloat(result, >=, 0.0);
144 g_assert_cmpfloat(result, <=, DBL_MIN);
149 g_assert_cmpfloat(result, <=, 0.0);
150 g_assert_cmpfloat(result, >=, -DBL_MIN);
153 int main(
int argc,
char **argv)
155 g_test_init(&argc, &argv, NULL);
158 g_test_add_func(
"/common/strings/double/empty_input", empty_input_string);
159 g_test_add_func(
"/common/strings/double/bad_input", bad_input_string);
160 g_test_add_func(
"/common/strings/double/trailing_chars", trailing_chars);
163 g_test_add_func(
"/common/strings/double/typical", typical_case);
164 g_test_add_func(
"/common/strings/double/overflow", double_overflow);
165 g_test_add_func(
"/common/strings/double/underflow", double_underflow);
#define ASSERT_DBL_EQ(d1, d2)
#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)