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

[patches] [2.3] Backport test fix



I've applied this backport of a testcase fix to EGLIBC 2.3 branch.

Index: stdio-common/tstdiomisc.c
===================================================================
--- stdio-common/tstdiomisc.c	(revision 1556)
+++ stdio-common/tstdiomisc.c	(working copy)
@@ -46,6 +46,9 @@
   return result;
 }
 
+volatile double nanval;
+
+
 static int
 F (void)
 {
@@ -53,8 +56,9 @@
   wchar_t wbuf[10];
   int result;
 
-  snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
-	    DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+  nanval = NAN;
+
+  snprintf (buf, sizeof buf, "%f %F", nanval, nanval);
   result = strcmp (buf, "nan NAN") != 0;
   printf ("expected \"nan NAN\", got \"%s\"\n", buf);
 
@@ -62,9 +66,7 @@
   result |= strcmp (buf, "inf INF") != 0;
   printf ("expected \"inf INF\", got \"%s\"\n", buf);
 
-  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
-	    DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
-	    DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", nanval, nanval);
   result |= wcscmp (wbuf, L"nan NAN") != 0;
   printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf);
 
Index: ChangeLog.eglibc
===================================================================
--- ChangeLog.eglibc	(revision 1556)
+++ ChangeLog.eglibc	(working copy)
@@ -1,3 +1,9 @@
+2007-02-23  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	Backport from mainline.
+	2006-01-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+	* stdio-common/tstdiomisc.c (F): Use NAN to get NaN value.
+
 2006-11-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/arm/eabi/bits/predefs.h (__STDC_IEC_559__,

-- 
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx