From 491732c99d8718d2068ecfe614038a801f903cc2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 26 Oct 2004 04:16:02 +0000 Subject: [PATCH] Improve error reporting. 2004-10-26 Matthias Clasen * tests/strtod-test.c (test_string): Improve error reporting. --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-12 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ tests/strtod-test.c | 7 ++++--- 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bee809a..bb6366c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-10-26 Matthias Clasen + + * tests/strtod-test.c (test_string): Improve error reporting. + Mon Oct 25 15:05:18 2004 Manish Singh * autogen.sh: rm autom4te.cache, since it might interfere with diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8bee809a..bb6366c9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2004-10-26 Matthias Clasen + + * tests/strtod-test.c (test_string): Improve error reporting. + Mon Oct 25 15:05:18 2004 Manish Singh * autogen.sh: rm autom4te.cache, since it might interfere with diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 8bee809a..bb6366c9 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,7 @@ +2004-10-26 Matthias Clasen + + * tests/strtod-test.c (test_string): Improve error reporting. + Mon Oct 25 15:05:18 2004 Manish Singh * autogen.sh: rm autom4te.cache, since it might interfere with diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8bee809a..bb6366c9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +2004-10-26 Matthias Clasen + + * tests/strtod-test.c (test_string): Improve error reporting. + Mon Oct 25 15:05:18 2004 Manish Singh * autogen.sh: rm autom4te.cache, since it might interfere with diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8bee809a..bb6366c9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2004-10-26 Matthias Clasen + + * tests/strtod-test.c (test_string): Improve error reporting. + Mon Oct 25 15:05:18 2004 Manish Singh * autogen.sh: rm autom4te.cache, since it might interfere with diff --git a/tests/strtod-test.c b/tests/strtod-test.c index 703f11ce..7e45570c 100644 --- a/tests/strtod-test.c +++ b/tests/strtod-test.c @@ -27,11 +27,11 @@ test_string (char *number, double res, gboolean check_end, int correct_len) setlocale (LC_NUMERIC, locales[l]); d = g_ascii_strtod (number, &end); if (d != res) - g_print ("g_ascii_strtod for locale %s failed\n", locales[l]); + g_print ("g_ascii_strtod on \"%s\" for locale %s failed\n", number, locales[l]); if (check_end && end - number != correct_len) - g_print ("g_ascii_strtod for locale %s endptr was wrong\n", locales[l]); + g_print ("g_ascii_strtod on \"%s\" for locale %s endptr was wrong, leftover: %s\n", number, locales[l], end); if (!check_end && end - number != strlen (number)) - g_print ("g_ascii_strtod for locale %s endptr was wrong\n", locales[l]); + g_print ("g_ascii_strtod on \"%s\" for locale %s endptr was wrong, leftover: %s\n", number, locales[l], end); } g_free (number); @@ -50,6 +50,7 @@ main () test_string ("-123.123", -123.123, FALSE, 0); test_string ("-123.123e2", -123.123e2, FALSE, 0); test_string ("-123.123e-2", -123.123e-2, FALSE, 0); + test_string ("1e1", 1e1, FALSE, 0); test_string ("5.4", 5.4, TRUE, 3); test_string ("5.4,5.5", 5.4, TRUE, 3); test_string ("5,4", 5.0, TRUE, 1); -- 2.34.1