Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79457 - trunk/libs/type_traits/test
From: john_at_[hidden]
Date: 2012-07-12 13:21:54


Author: johnmaddock
Date: 2012-07-12 13:21:53 EDT (Thu, 12 Jul 2012)
New Revision: 79457
URL: http://svn.boost.org/trac/boost/changeset/79457

Log:
Add strongly typed enum test.
Text files modified:
   trunk/libs/type_traits/test/is_enum_test.cpp | 12 ++++++++++++
   1 files changed, 12 insertions(+), 0 deletions(-)

Modified: trunk/libs/type_traits/test/is_enum_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_enum_test.cpp (original)
+++ trunk/libs/type_traits/test/is_enum_test.cpp 2012-07-12 13:21:53 EDT (Thu, 12 Jul 2012)
@@ -12,6 +12,15 @@
 # include <boost/type_traits/is_enum.hpp>
 #endif
 
+#ifndef BOOST_NO_SCOPED_ENUMS
+
+enum class test_enum
+{
+ a, b
+};
+
+#endif
+
 TT_TEST_BEGIN(is_enum)
 
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int>::value, false);
@@ -24,6 +33,9 @@
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<boost::noncopyable>::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<void>::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_abc1>::value, false);
+#ifndef BOOST_NO_SCOPED_ENUMS
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_enum>::value, true);
+#endif
 
 TT_TEST_END
 


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