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

[commits] r8854 - /libdfp/trunk/tests/test-printf.c



Author: ryanarn
Date: Fri Aug 21 07:43:12 2009
New Revision: 8854

Log:
2009-08-21  Ryan S. Arnold  <rsa@xxxxxxxxxx>

	* tests/test-printf.c: Added mechanism to easily add new printf test
	cases based upon GLIBC's stdio-common/tfformat.c testcase.

Modified:
    libdfp/trunk/tests/test-printf.c

Modified: libdfp/trunk/tests/test-printf.c
==============================================================================
--- libdfp/trunk/tests/test-printf.c (original)
+++ libdfp/trunk/tests/test-printf.c Fri Aug 21 07:43:12 2009
@@ -35,10 +35,10 @@
 
 /* Inspired by GLIBC stdio-common/tfformat.c  */
 typedef struct{
-	  int line;
-	  _Decimal128 d;
-	  const char *expect;
-	  const char *format;
+  int line;
+  _Decimal128 d;
+  const char *expect;
+  const char *format;
 } d128_type;
 
 d128_type printf_d128s[] =
@@ -48,8 +48,6 @@
   {__LINE__, 231.2315DL, "231.232", "%.3DDf"},
   /* Four digits of precision right of the decimal place.  */
   {__LINE__, 231.2315DL, "231.2315", "%.4DDf"},
-  /* Default six digits of precision right of the decimal place.  */
-  {__LINE__, 231.2311116DL, "231.231112", "%DDf"},
   /* Space padded to 12,  Right justified.  */
   {__LINE__, 231.2315DL, "12.3", "%12.3DDf"},
   /* Left justified, Space padded to 12.  */
@@ -67,11 +65,17 @@
 
   register_printf_dfp();
 
+  /* We do this to make sure that the registration didn't mess up the printf
+   * internals.  */
+  fprintf(stdout, "Testing marker after register_printf_dfp() invocation.\n");
+  _PC("1.234567e+00", "%e", (double) 1.234567);
+
   for (dptr = printf_d128s; dptr->line; dptr++)
     {
       _PC_P(__FILE__,dptr->line, dptr->expect,dptr->format,dptr->d);
     }
 
   _REPORT();
-  return 0;
+
+  return fail;
 }