stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r366898 - /incubator/stdcxx/trunk/tests/self/0.printf.cpp
Date Sat, 07 Jan 2006 19:57:55 GMT
Author: sebor
Date: Sat Jan  7 11:57:52 2006
New Revision: 366898

URL: http://svn.apache.org/viewcvs?rev=366898&view=rev
Log:
2006-01-07  Martin Sebor  <sebor@roguewave.com>

	* 0.printf.cpp (test_bool): New function to exercise the 'b' format
	specifier.
	(test_integer): Called test_bool.

Modified:
    incubator/stdcxx/trunk/tests/self/0.printf.cpp

Modified: incubator/stdcxx/trunk/tests/self/0.printf.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/self/0.printf.cpp?rev=366898&r1=366897&r2=366898&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/self/0.printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/self/0.printf.cpp Sat Jan  7 11:57:52 2006
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
+#include <time.h>
 #include <wchar.h>
 
 #include <ios>
@@ -781,6 +782,27 @@
 
 /***********************************************************************/
 
+void test_bool ()
+{
+    printf ("%s\n", "extension: \"%b\": bool");
+
+    TEST ("%b", false, 0, 0, "false");
+    TEST ("%b", true,  0, 0, "true");
+
+    TEST ("%b", '\0',    0, 0, "false");
+    TEST ("%b", '\x01',  0, 0, "true");
+    TEST ("%b", '\x80',  0, 0, "true");
+    TEST ("%b", '\xff',  0, 0, "true");
+
+    TEST ("%b",  0, 0, 0, "false");
+    TEST ("%b", -1, 0, 0, "true");
+    TEST ("%b", +1, 0, 0, "true");
+    TEST ("%b", -2, 0, 0, "true");
+    TEST ("%b", +2, 0, 0, "true");
+}
+
+/***********************************************************************/
+
 void test_integer ()
 {
     test_dec ('d');
@@ -791,6 +813,8 @@
 
     test_hex ('x');
     test_hex ('X');
+
+    test_bool ();
 }
 
 /***********************************************************************/



Mime
View raw message