Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/locale Revert 1.4 (perhaps temporarily) and a...



details:   https://anonhg.NetBSD.org/src/rev/1b27eb1573f0
branches:  trunk
changeset: 357815:1b27eb1573f0
user:      kre <kre%NetBSD.org@localhost>
date:      Tue Nov 28 23:26:01 2017 +0000

description:
Revert 1.4 (perhaps temporarily) and add even more diagnostics to those
added in 1.3 to see if it is possible to determine why the strict equality
test fails on i386, yet succeeds elsewhere.

diffstat:

 tests/lib/libc/locale/t_sprintf.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 2d86017f00db -r 1b27eb1573f0 tests/lib/libc/locale/t_sprintf.c
--- a/tests/lib/libc/locale/t_sprintf.c Tue Nov 28 22:25:16 2017 +0000
+++ b/tests/lib/libc/locale/t_sprintf.c Tue Nov 28 23:26:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sprintf.c,v 1.5 2017/11/24 21:30:43 kre Exp $ */
+/* $NetBSD: t_sprintf.c,v 1.6 2017/11/28 23:26:01 kre Exp $ */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2017\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sprintf.c,v 1.5 2017/11/24 21:30:43 kre Exp $");
+__RCSID("$NetBSD: t_sprintf.c,v 1.6 2017/11/28 23:26:01 kre Exp $");
 
 #include <locale.h>
 #include <math.h>
@@ -134,11 +134,15 @@
 
        ATF_REQUIRE_EQ((int)strtol(t->int_input, NULL, 10), t->int_value);
        d = strtod(t->double_input, NULL);
-       if ((diff = fabs(d - t->double_value)) > 1e-7)
-               ATF_REQUIRE_EQ_MSG(d, t->double_value, "In %s: d=strtod("
-                   "t->double_input[%s], NULL)[%.9g] != t->double_value[%.9g]"
-                   ": diff=%g", t->locale, t->double_input, d,
-                   t->double_value, diff);
+       diff = fabs(d - t->double_value);
+#if 0
+       if (diff >= 1e-7)
+#endif
+               ATF_REQUIRE_EQ_MSG(d, t->double_value, "In %s:"
+                   " d=strtod(t->double_input[%s], NULL)[%.12g = %a] !="
+                   " t->double_value[%.12g = %a]: diff=%g",
+                   t->locale, t->double_input, d, d,
+                   t->double_value, t->double_value, diff);
 }
 
 static void



Home | Main Index | Thread Index | Old Index