stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r672596 - /stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
Date Sun, 29 Jun 2008 00:47:23 GMT
Author: sebor
Date: Sat Jun 28 17:47:22 2008
New Revision: 672596

URL: http://svn.apache.org/viewvc?rev=672596&view=rev
Log:
2008-06-28  Martin Sebor  <sebor@roguewave.com>

	* tests/utilities/20.meta.unary.prop.cpp (cfun_t, incomplete_t): New
	types used for testing.
	(test_is_const, test_is_volatile): Exercised incomplete_t, arrays
	with unknown bounds, functions with C++ and C language linkage,
	and pointers to member functions.
	(test_is_trivial): Exercised void.

Modified:
    stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp?rev=672596&r1=672595&r2=672596&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp Sat Jun 28 17:47:22 2008
@@ -39,6 +39,12 @@
 
 /**************************************************************************/
 
+// function with C linkage
+extern "C" typedef void cfun_t ();
+
+// incomplete type (never defined)
+struct incomplete_t;
+
 struct struct_t {
     int i_; float f_;
 };
@@ -249,6 +255,11 @@
     TEST (std::is_const,  V void, false);
     TEST (std::is_const, CV void, true);
 
+    // incomplete type other than void
+    TEST (std::is_const,    incomplete_t, false);
+    TEST (std::is_const, C  incomplete_t, true);
+    TEST (std::is_const,  V incomplete_t, false);
+    TEST (std::is_const, CV incomplete_t, true);
 
     TEST (std::is_const,    int, false);
     TEST (std::is_const, C  int, true);
@@ -283,12 +294,30 @@
     TEST (std::is_const, CV int&, false);
 
     // array types
+    TEST (std::is_const,    int [], false);
+    TEST (std::is_const, C  int [], true);
+    TEST (std::is_const,  V int [], false);
+    TEST (std::is_const, CV int [], true);
+
     TEST (std::is_const,    int [2], false);
     TEST (std::is_const, C  int [2], true);
     TEST (std::is_const,  V int [2], false);
     TEST (std::is_const, CV int [2], true);
+
+    // array of incomplete type
+    TEST (std::is_const,    incomplete_t [], false);
+    TEST (std::is_const, C  incomplete_t [], true);
+    TEST (std::is_const,  V incomplete_t [], false);
+    TEST (std::is_const, CV incomplete_t [], true);
+
+    // C++ function, C function, and pointers to member functions
+    TEST (std::is_const,    void (),                    false);
+    TEST (std::is_const,    cfun_t,                     false);
+    TEST (std::is_const,    void (struct_t::*)(),       false);
+    TEST (std::is_const,    void (struct_t::*)() const, false);
 }
 
+
 void test_is_volatile ()
 {
     TEST (std::is_volatile,    void, false);
@@ -296,6 +325,12 @@
     TEST (std::is_volatile,  V void, true);
     TEST (std::is_volatile, CV void, true);
 
+    // incomplete type other than void
+    TEST (std::is_volatile,    incomplete_t, false);
+    TEST (std::is_volatile, C  incomplete_t, false);
+    TEST (std::is_volatile,  V incomplete_t, true);
+    TEST (std::is_volatile, CV incomplete_t, true);
+
     TEST (std::is_volatile,    int, false);
     TEST (std::is_volatile, C  int, false);
     TEST (std::is_volatile,  V int, true);
@@ -329,12 +364,30 @@
     TEST (std::is_volatile, CV int&, false);
 
     // array types
+    TEST (std::is_volatile,    int [], false);
+    TEST (std::is_volatile, C  int [], false);
+    TEST (std::is_volatile,  V int [], true);
+    TEST (std::is_volatile, CV int [], true);
+
     TEST (std::is_volatile,    int [2], false);
     TEST (std::is_volatile, C  int [2], false);
     TEST (std::is_volatile,  V int [2], true);
     TEST (std::is_volatile, CV int [2], true);
+
+    // array of incomplete type
+    TEST (std::is_volatile,    incomplete_t [], false);
+    TEST (std::is_volatile, C  incomplete_t [], false);
+    TEST (std::is_volatile,  V incomplete_t [], true);
+    TEST (std::is_volatile, CV incomplete_t [], true);
+
+    // C++ function, C function, and pointers to member functions
+    TEST (std::is_volatile,    void (),                       false);
+    TEST (std::is_volatile,    cfun_t,                        false);
+    TEST (std::is_volatile,    void (struct_t::*)(),          false);
+    TEST (std::is_volatile,    void (struct_t::*)() volatile, false);
 }
 
+
 static void test_has_trivial_assign ()
 {
     TEST (std::has_trivial_assign, long, true);
@@ -376,6 +429,11 @@
 
 static void test_is_trivial ()
 {
+    TEST (std::is_trivial,    void, false);
+    TEST (std::is_trivial, C  void, false);
+    TEST (std::is_trivial, V  void, false);
+    TEST (std::is_trivial, CV void, false);
+
     TEST (std::is_trivial, long, true);
     TEST (std::is_trivial, C long, true);
     TEST (std::is_trivial, V long, true);



Mime
View raw message