mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-04 23:34:29 +02:00
Stop using assert() in tests so we can test with NDEBUG defined.
[SVN r33026]
This commit is contained in:
10
test/Jamfile
10
test/Jamfile
@@ -18,7 +18,7 @@ compile at.cpp ;
|
|||||||
compile back.cpp ;
|
compile back.cpp ;
|
||||||
compile bind.cpp ;
|
compile bind.cpp ;
|
||||||
compile bitwise.cpp ;
|
compile bitwise.cpp ;
|
||||||
compile bool.cpp ;
|
run bool.cpp ;
|
||||||
compile comparison.cpp ;
|
compile comparison.cpp ;
|
||||||
compile contains.cpp ;
|
compile contains.cpp ;
|
||||||
compile copy.cpp ;
|
compile copy.cpp ;
|
||||||
@@ -36,7 +36,7 @@ compile filter_view.cpp ;
|
|||||||
compile find.cpp ;
|
compile find.cpp ;
|
||||||
compile find_if.cpp ;
|
compile find_if.cpp ;
|
||||||
compile fold.cpp ;
|
compile fold.cpp ;
|
||||||
unit-test for_each : for_each.cpp : <sysinclude>$(BOOST_ROOT) ;
|
run for_each.cpp ;
|
||||||
compile front.cpp ;
|
compile front.cpp ;
|
||||||
compile has_xxx.cpp ;
|
compile has_xxx.cpp ;
|
||||||
compile identity.cpp ;
|
compile identity.cpp ;
|
||||||
@@ -45,8 +45,8 @@ compile index_of.cpp ;
|
|||||||
compile inherit.cpp ;
|
compile inherit.cpp ;
|
||||||
compile insert.cpp ;
|
compile insert.cpp ;
|
||||||
compile insert_range.cpp ;
|
compile insert_range.cpp ;
|
||||||
compile int.cpp ;
|
run int.cpp ;
|
||||||
compile integral_c.cpp ;
|
run integral_c.cpp ;
|
||||||
compile is_placeholder.cpp ;
|
compile is_placeholder.cpp ;
|
||||||
compile is_sequence.cpp ;
|
compile is_sequence.cpp ;
|
||||||
compile iterator_tags.cpp ;
|
compile iterator_tags.cpp ;
|
||||||
@@ -80,7 +80,7 @@ compile set.cpp ;
|
|||||||
compile set_c.cpp ;
|
compile set_c.cpp ;
|
||||||
compile single_view.cpp ;
|
compile single_view.cpp ;
|
||||||
compile size.cpp ;
|
compile size.cpp ;
|
||||||
compile size_t.cpp ;
|
run size_t.cpp ;
|
||||||
compile sizeof.cpp ;
|
compile sizeof.cpp ;
|
||||||
compile sort.cpp ;
|
compile sort.cpp ;
|
||||||
compile stable_partition.cpp ;
|
compile stable_partition.cpp ;
|
||||||
|
@@ -14,7 +14,7 @@ compile at.cpp ;
|
|||||||
compile back.cpp ;
|
compile back.cpp ;
|
||||||
compile bind.cpp ;
|
compile bind.cpp ;
|
||||||
compile bitwise.cpp ;
|
compile bitwise.cpp ;
|
||||||
compile bool.cpp ;
|
run bool.cpp ;
|
||||||
compile comparison.cpp ;
|
compile comparison.cpp ;
|
||||||
compile contains.cpp ;
|
compile contains.cpp ;
|
||||||
compile copy.cpp ;
|
compile copy.cpp ;
|
||||||
@@ -41,8 +41,8 @@ compile index_of.cpp ;
|
|||||||
compile inherit.cpp ;
|
compile inherit.cpp ;
|
||||||
compile insert.cpp ;
|
compile insert.cpp ;
|
||||||
compile insert_range.cpp ;
|
compile insert_range.cpp ;
|
||||||
compile int.cpp ;
|
run int.cpp ;
|
||||||
compile integral_c.cpp ;
|
run integral_c.cpp ;
|
||||||
compile is_placeholder.cpp ;
|
compile is_placeholder.cpp ;
|
||||||
compile is_sequence.cpp ;
|
compile is_sequence.cpp ;
|
||||||
compile iterator_tags.cpp ;
|
compile iterator_tags.cpp ;
|
||||||
@@ -76,7 +76,7 @@ compile set.cpp ;
|
|||||||
compile set_c.cpp ;
|
compile set_c.cpp ;
|
||||||
compile single_view.cpp ;
|
compile single_view.cpp ;
|
||||||
compile size.cpp ;
|
compile size.cpp ;
|
||||||
compile size_t.cpp ;
|
run size_t.cpp ;
|
||||||
compile sizeof.cpp ;
|
compile sizeof.cpp ;
|
||||||
compile sort.cpp ;
|
compile sort.cpp ;
|
||||||
compile stable_partition.cpp ;
|
compile stable_partition.cpp ;
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
{ MPL_ASSERT(( is_same< bool_<c>, c##_ > )); } \
|
{ MPL_ASSERT(( is_same< bool_<c>, c##_ > )); } \
|
||||||
{ MPL_ASSERT(( is_same< bool_<c>::type, bool_<c> > )); } \
|
{ MPL_ASSERT(( is_same< bool_<c>::type, bool_<c> > )); } \
|
||||||
{ MPL_ASSERT_RELATION( bool_<c>::value, ==, c ); } \
|
{ MPL_ASSERT_RELATION( bool_<c>::value, ==, c ); } \
|
||||||
assert( bool_<c>() == c ); \
|
BOOST_TEST( bool_<c>() == c ); \
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
MPL_TEST_CASE()
|
MPL_TEST_CASE()
|
||||||
|
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||||
# define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
# define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
||||||
assert(( WRAPPER(T,i)() == i )); \
|
BOOST_TEST(( WRAPPER(T,i)() == i )); \
|
||||||
assert(( WRAPPER(T,i)::value == i )); \
|
BOOST_TEST(( WRAPPER(T,i)::value == i )); \
|
||||||
/**/
|
/**/
|
||||||
#else
|
#else
|
||||||
# define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
# define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
||||||
assert(( WRAPPER(T,i)::value == i )); \
|
BOOST_TEST(( WRAPPER(T,i)::value == i )); \
|
||||||
/**/
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
18
test/set.cpp
18
test/set.cpp
@@ -68,9 +68,9 @@ MPL_TEST_CASE()
|
|||||||
typedef begin<s2>::type first2;
|
typedef begin<s2>::type first2;
|
||||||
typedef end<s2>::type last2;
|
typedef end<s2>::type last2;
|
||||||
|
|
||||||
MPL_ASSERT(( is_same< first2::type, int > ));
|
MPL_ASSERT(( is_same< deref<first2>::type, int > ));
|
||||||
typedef next<first2>::type iter;
|
typedef next<first2>::type iter;
|
||||||
MPL_ASSERT(( is_same< iter::type, char > ));
|
MPL_ASSERT(( is_same< deref<iter>::type, char > ));
|
||||||
MPL_ASSERT(( is_same< next<iter>::type, last2 > ));
|
MPL_ASSERT(( is_same< next<iter>::type, last2 > ));
|
||||||
|
|
||||||
typedef insert<s2,int>::type s2_1;
|
typedef insert<s2,int>::type s2_1;
|
||||||
@@ -166,15 +166,15 @@ MPL_TEST_CASE()
|
|||||||
|
|
||||||
// Use a template for testing so that GCC will show us the actual types involved
|
// Use a template for testing so that GCC will show us the actual types involved
|
||||||
template <class S>
|
template <class S>
|
||||||
struct test
|
void test()
|
||||||
{
|
{
|
||||||
MPL_ASSERT_RELATION( size<S>::value, ==, 3 );
|
MPL_ASSERT_RELATION( size<S>::value, ==, 3 );
|
||||||
|
|
||||||
typedef typename end<S>::type not_found;
|
typedef typename end<S>::type not_found;
|
||||||
BOOST_MPL_ASSERT_NOT(( is_same<typename find<S,int>::type,not_found> ));
|
BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,int>::type,not_found> ));
|
||||||
BOOST_MPL_ASSERT_NOT(( is_same<typename find<S,long>::type,not_found> ));
|
BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,long>::type,not_found> ));
|
||||||
BOOST_MPL_ASSERT_NOT(( is_same<typename find<S,char>::type,not_found> ));
|
BOOST_MPL_ASSERT_NOT(( is_same<BOOST_DEDUCED_TYPENAME find<S,char>::type,not_found> ));
|
||||||
BOOST_MPL_ASSERT(( is_same<typename find<S,char*>::type,not_found> ));
|
BOOST_MPL_ASSERT(( is_same<BOOST_DEDUCED_TYPENAME find<S,char*>::type,not_found> ));
|
||||||
};
|
};
|
||||||
|
|
||||||
MPL_TEST_CASE()
|
MPL_TEST_CASE()
|
||||||
@@ -185,6 +185,6 @@ MPL_TEST_CASE()
|
|||||||
|
|
||||||
typedef mpl::set<int,long,char> myset;
|
typedef mpl::set<int,long,char> myset;
|
||||||
|
|
||||||
test<myset> x;
|
test<myset>();
|
||||||
test<myset::type> y;
|
test<myset::type>();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user