|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74179 - in sandbox/enums/libs/enums/test: . enum_class/meta enum_type enum_type/meta
From: vicente.botet_at_[hidden]
Date: 2011-08-31 18:18:32
Author: viboes
Date: 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
New Revision: 74179
URL: http://svn.boost.org/trac/boost/changeset/74179
Log:
Enums: update static integer assertions
Text files modified:
sandbox/enums/libs/enums/test/Jamfile.v2 | 2 +-
sandbox/enums/libs/enums/test/enum_class/meta/first_pass.cpp | 12 +++++++-----
sandbox/enums/libs/enums/test/enum_class/meta/last_pass.cpp | 9 ++++-----
sandbox/enums/libs/enums/test/enum_class/meta/pos_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_class/meta/pred_pass.cpp | 14 ++++++--------
sandbox/enums/libs/enums/test/enum_class/meta/size_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_class/meta/succ_pass.cpp | 14 ++++++--------
sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_class/meta/val_pass.cpp | 9 ++++-----
sandbox/enums/libs/enums/test/enum_type/is_enum_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/meta/first_pass.cpp | 7 +++----
sandbox/enums/libs/enums/test/enum_type/meta/last_pass.cpp | 9 ++++-----
sandbox/enums/libs/enums/test/enum_type/meta/pos_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/meta/pred_pass.cpp | 14 ++++++--------
sandbox/enums/libs/enums/test/enum_type/meta/size_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/meta/succ_pass.cpp | 14 ++++++--------
sandbox/enums/libs/enums/test/enum_type/meta/val_of_invalid_fail.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/meta/val_pass.cpp | 9 ++++-----
18 files changed, 58 insertions(+), 69 deletions(-)
Modified: sandbox/enums/libs/enums/test/Jamfile.v2
==============================================================================
--- sandbox/enums/libs/enums/test/Jamfile.v2 (original)
+++ sandbox/enums/libs/enums/test/Jamfile.v2 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -37,7 +37,7 @@
<toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
<toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
<toolset>msvc:<cxxflags>/wd4127
- <define>BOOST_ENUMS_NOT_DEPENDS_ON_CONVERSION
+ #<define>BOOST_ENUMS_NOT_DEPENDS_ON_CONVERSION
;
test-suite "enum_class"
Modified: sandbox/enums/libs/enums/test/enum_class/meta/first_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/first_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/first_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,11 +19,13 @@
using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::first<EnumClass>::value>,
- mpl::enum_c<EnumClass, EnumClass::Default>
- >::value));
+ {
+ BOOST_STATIC_ASSERT((
+ 0 == 1-1
+ ));
+ BOOST_STATIC_ASSERT((
+ int(meta::first<EnumClass>::value) == int(EnumClass::Default)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/last_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/last_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/last_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,11 +19,10 @@
using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::last<EnumClass>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum2>
- >::value));
+ {
+ BOOST_STATIC_ASSERT((
+ int(meta::last<EnumClass>::value) == int(EnumClass::Enum2)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/pos_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/pos_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/pos_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,7 +19,7 @@
//~ using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
BOOST_STATIC_ASSERT((meta::pos<EnumClass, EnumClass::Enum1>::value == 1));
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/pred_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/pred_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/pred_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -21,15 +21,13 @@
using namespace boost::enums;
{
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::pred<EnumClass,EnumClass::Enum1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Default>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::pred<EnumClass,EnumClass::Enum1>::value) == int(EnumClass::Default)
+ ));
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::pred<EnumClass,EnumClass::Enum2>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::pred<EnumClass,EnumClass::Enum2>::value) == int(EnumClass::Enum1)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/size_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/size_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/size_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -16,7 +16,7 @@
void pass() {
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
BOOST_STATIC_ASSERT(meta::size<EnumClass>::value == 3);
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/succ_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/succ_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/succ_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -21,15 +21,13 @@
using namespace boost::enums;
{
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::succ<EnumClass,EnumClass::Default>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::succ<EnumClass,EnumClass::Default>::value) == int(EnumClass::Enum1)
+ ));
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::succ<EnumClass,EnumClass::Enum1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum2>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::succ<EnumClass,EnumClass::Enum1>::value) == int(EnumClass::Enum2)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -16,7 +16,7 @@
void fail() {
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
native_type<EnumClass>::type e= meta::val<EnumClass,3>::value;
(void)(e);
}
Modified: sandbox/enums/libs/enums/test/enum_class/meta/val_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/val_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/val_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,11 +19,10 @@
using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::val<EnumClass,1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ {
+ BOOST_STATIC_ASSERT((
+ int(meta::val<EnumClass,1>::value) == int(EnumClass::Enum1)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_type/is_enum_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/is_enum_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/is_enum_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -17,7 +17,7 @@
void pass() {
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
BOOST_STATIC_ASSERT((boost::enums::is_enum<EnumClass>::value));
BOOST_STATIC_ASSERT((!boost::enums::is_enum<int>::value));
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/first_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/first_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/first_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -20,10 +20,9 @@
using namespace boost::enums;
{ // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::first<EnumClass>::value>,
- mpl::enum_c<EnumClass, EnumClass::Default>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::first<EnumClass>::value) == int(EnumClass::Default)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/last_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/last_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/last_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,11 +19,10 @@
using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::last<EnumClass>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum2>
- >::value));
+ {
+ BOOST_STATIC_ASSERT((
+ int(meta::last<EnumClass>::value) == int(EnumClass::Enum2)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/pos_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/pos_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/pos_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,7 +19,7 @@
//~ using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
BOOST_STATIC_ASSERT((meta::pos<EnumClass, EnumClass::Enum1>::value == 1));
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/pred_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/pred_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/pred_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -21,15 +21,13 @@
using namespace boost::enums;
{
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::pred<EnumClass,EnumClass::Enum1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Default>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::pred<EnumClass,EnumClass::Enum1>::value) == int(EnumClass::Default)
+ ));
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::pred<EnumClass,EnumClass::Enum2>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::pred<EnumClass,EnumClass::Enum2>::value) == int(EnumClass::Enum1)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/size_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/size_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/size_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -16,7 +16,7 @@
void pass() {
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
BOOST_STATIC_ASSERT(meta::size<EnumClass>::value == 3);
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/succ_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/succ_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/succ_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -21,15 +21,13 @@
using namespace boost::enums;
{
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::succ<EnumClass,EnumClass::Default>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::succ<EnumClass,EnumClass::Default>::value) == int(EnumClass::Enum1)
+ ));
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::succ<EnumClass,EnumClass::Enum1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum2>
- >::value));
+ BOOST_STATIC_ASSERT((
+ int(meta::succ<EnumClass,EnumClass::Enum1>::value) == int(EnumClass::Enum2)
+ ));
}
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/val_of_invalid_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/val_of_invalid_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/val_of_invalid_fail.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -16,7 +16,7 @@
void fail() {
using namespace boost::enums;
- { // has the same size as the underlying type
+ {
native_type<EnumClass>::type e= meta::val<EnumClass,3>::value;
(void)(e);
}
Modified: sandbox/enums/libs/enums/test/enum_type/meta/val_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/meta/val_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/meta/val_pass.cpp 2011-08-31 18:18:29 EDT (Wed, 31 Aug 2011)
@@ -19,11 +19,10 @@
using namespace boost;
using namespace boost::enums;
- { // has the same size as the underlying type
- BOOST_STATIC_ASSERT((mpl::equal_to<
- mpl::enum_c<EnumClass, meta::val<EnumClass,1>::value>,
- mpl::enum_c<EnumClass, EnumClass::Enum1>
- >::value));
+ {
+ BOOST_STATIC_ASSERT((
+ int(meta::val<EnumClass,1>::value) == int(EnumClass::Enum1)
+ ));
}
}
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