Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56149 - trunk/libs/serialization/test
From: ramey_at_[hidden]
Date: 2009-09-11 13:58:58


Author: ramey
Date: 2009-09-11 13:58:57 EDT (Fri, 11 Sep 2009)
New Revision: 56149
URL: http://svn.boost.org/trac/boost/changeset/56149

Log:
enhanced test
Text files modified:
   trunk/libs/serialization/test/test_static_warning.cpp | 22 ++++++++++------------
   1 files changed, 10 insertions(+), 12 deletions(-)

Modified: trunk/libs/serialization/test/test_static_warning.cpp
==============================================================================
--- trunk/libs/serialization/test/test_static_warning.cpp (original)
+++ trunk/libs/serialization/test/test_static_warning.cpp 2009-09-11 13:58:57 EDT (Fri, 11 Sep 2009)
@@ -8,10 +8,10 @@
 // note: this is a compile only test.
 
 #include <boost/config.hpp> // BOOST_STATIC_CONST
-#include <boost/serialization/static_warning.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/type_traits/is_polymorphic.hpp>
 
-#pragma warning(disable:4094)
+#include <boost/serialization/static_warning.hpp>
 
 typedef char a1[2];
 typedef char a2[3];
@@ -23,18 +23,14 @@
 class non_polymorphic {
 };
 
-class test_class {
-};
-
-template <class T>
-int f()
-{
+template<class T>
+int f(){
     BOOST_STATIC_WARNING(T::value);
     return 0;
-}
+}
 
 struct A {
- BOOST_STATIC_CONSTANT(bool, value = 0);
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 /////////////////////////////////////////////////////////////////////////
@@ -44,7 +40,10 @@
 BOOST_STATIC_WARNING(true);
 
 // the following should show 5 warning message
-int x = f<A>();
+int x = f<A>(); // Warn
+int y = f<boost::is_polymorphic<non_polymorphic> >(); // Warn.
+int z = f<boost::is_polymorphic<polymorphic> >();
+
 BOOST_STATIC_WARNING(sizeof(a1) == sizeof(a2)); // Warn.
 BOOST_STATIC_WARNING(sizeof(a1) != sizeof(a1)); // Warn.
 BOOST_STATIC_WARNING(! boost::is_polymorphic<polymorphic>::value); // Warn.
@@ -62,4 +61,3 @@
     BOOST_STATIC_WARNING(boost::is_polymorphic<non_polymorphic>::value); // Warn.
     return 0;
 }
-


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk