summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-10-26 04:16:02 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-10-26 04:16:02 +0000
commit491732c99d8718d2068ecfe614038a801f903cc2 (patch)
tree5f8d24b31f5e008a20d1d9d6b18deb1a68db7f20 /tests
parent5c38cfa58d8de900b97206f53502912ff145754a (diff)
Improve error reporting.
2004-10-26 Matthias Clasen <mclasen@redhat.com> * tests/strtod-test.c (test_string): Improve error reporting.
Diffstat (limited to 'tests')
-rw-r--r--tests/strtod-test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/strtod-test.c b/tests/strtod-test.c
index 703f11ce6..7e45570ce 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);