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 Add some diagnostics to the strto test...



details:   https://anonhg.NetBSD.org/src/rev/1dbae17b19d9
branches:  trunk
changeset: 828032:1dbae17b19d9
user:      kre <kre%NetBSD.org@localhost>
date:      Thu Nov 23 23:47:09 2017 +0000

description:
Add some diagnostics to the strto test, so I can see why this
fails on i386 (on qemu) - will probably keep them when done.

diffstat:

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

diffs (37 lines):

diff -r 089b9b9e9e03 -r 1dbae17b19d9 tests/lib/libc/locale/t_sprintf.c
--- a/tests/lib/libc/locale/t_sprintf.c Thu Nov 23 19:53:20 2017 +0000
+++ b/tests/lib/libc/locale/t_sprintf.c Thu Nov 23 23:47:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sprintf.c,v 1.3 2017/07/12 17:32:51 perseant Exp $ */
+/* $NetBSD: t_sprintf.c,v 1.4 2017/11/23 23:47:09 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.3 2017/07/12 17:32:51 perseant Exp $");
+__RCSID("$NetBSD: t_sprintf.c,v 1.4 2017/11/23 23:47:09 kre Exp $");
 
 #include <locale.h>
 #include <stdio.h>
@@ -125,12 +125,17 @@
 static void
 h_strto(const struct test *t)
 {
+       double d;
+
        ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
        printf("Trying locale %s...\n", t->locale);
        ATF_REQUIRE(setlocale(LC_NUMERIC, t->locale) != NULL);
 
        ATF_REQUIRE_EQ((int)strtol(t->int_input, NULL, 10), t->int_value);
-       ATF_REQUIRE_EQ(strtod(t->double_input, NULL), t->double_value);
+       d = strtod(t->double_input, NULL);
+       ATF_REQUIRE_EQ_MSG(d, t->double_value, "In %s: "
+           "strtod(t->double_input[%s], NULL)[%g] != t->double_value[%g]",
+           t->locale, t->double_input, d, t->double_value);
 }
 
 static void



Home | Main Index | Thread Index | Old Index