|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61997 - sandbox/SOC/2010/bit_masks/lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-05-15 12:42:23
Author: bbartman
Date: 2010-05-15 12:42:22 EDT (Sat, 15 May 2010)
New Revision: 61997
URL: http://svn.boost.org/trac/boost/changeset/61997
Log:
testing framework for high low mask is complete
Text files modified:
sandbox/SOC/2010/bit_masks/lib/integer/test/high_bit_mask_test.cpp | 22 +++++++++++-----------
sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 20 ++++++++++----------
sandbox/SOC/2010/bit_masks/lib/integer/test/test_type_list.hpp | 36 +-----------------------------------
3 files changed, 22 insertions(+), 56 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/high_bit_mask_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/high_bit_mask_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/high_bit_mask_test.cpp 2010-05-15 12:42:22 EDT (Sat, 15 May 2010)
@@ -17,22 +17,22 @@
void test_function() {
// making sure that the value type is transfered correctly.
- BOOST_TEST((is_same< typename high_bits<T, 3>::value_type, T >::value));
+ BOOST_ASSERT((is_same< typename high_bits<T, 3>::value_type, T >::value));
- BOOST_TEST(( boost::high_bits<T,1>::value == ~(~(T(0)) >> 1) ));
- BOOST_TEST(( boost::high_bits<T,2>::value == ~(~(T(0)) >> 2) ));
- BOOST_TEST(( boost::high_bits<T,3>::value == ~(~(T(0)) >> 3) ));
- BOOST_TEST(( boost::high_bits<T,4>::value == ~(~(T(0)) >> 4) ));
- BOOST_TEST(( boost::high_bits<T,5>::value == ~(~(T(0)) >> 5) ));
- BOOST_TEST(( boost::high_bits<T,6>::value == ~(~(T(0)) >> 6) ));
- BOOST_TEST(( boost::high_bits<T,7>::value == ~(~(T(0)) >> 7) ));
- BOOST_TEST(( boost::high_bits<T,8>::value == ~(~(T(0)) >> 8) ));
+ BOOST_ASSERT(( boost::high_bits<T,1>::value == ~(~(T(0)) >> 1) ));
+ BOOST_ASSERT(( boost::high_bits<T,2>::value == ~(~(T(0)) >> 2) ));
+ BOOST_ASSERT(( boost::high_bits<T,3>::value == ~(~(T(0)) >> 3) ));
+ BOOST_ASSERT(( boost::high_bits<T,4>::value == ~(~(T(0)) >> 4) ));
+ BOOST_ASSERT(( boost::high_bits<T,5>::value == ~(~(T(0)) >> 5) ));
+ BOOST_ASSERT(( boost::high_bits<T,6>::value == ~(~(T(0)) >> 6) ));
+ BOOST_ASSERT(( boost::high_bits<T,7>::value == ~(~(T(0)) >> 7) ));
+ BOOST_ASSERT(( boost::high_bits<T,8>::value == ~(~(T(0)) >> 8) ));
// assert that type returns the correct typedef.
- BOOST_TEST(( is_same<
+ BOOST_ASSERT(( is_same<
typename high_bits<T, 3>::type,
- low_bits<T, 3> >::value
+ high_bits<T, 3> >::value
));
}
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp 2010-05-15 12:42:22 EDT (Sat, 15 May 2010)
@@ -17,20 +17,20 @@
void test_function() {
// making sure that the value type is transfered correctly.
- BOOST_TEST((is_same< typename low_bits<T, 3>::value_type, T >::value));
+ BOOST_ASSERT((is_same< typename low_bits<T, 3>::value_type, T >::value));
- BOOST_TEST(( boost::low_bits<T,1>::value == 1));
- BOOST_TEST(( boost::low_bits<T,2>::value == 3));
- BOOST_TEST(( boost::low_bits<T,3>::value == 7));
- BOOST_TEST(( boost::low_bits<T,4>::value == 15));
- BOOST_TEST(( boost::low_bits<T,5>::value == 31));
- BOOST_TEST(( boost::low_bits<T,6>::value == 63));
- BOOST_TEST(( boost::low_bits<T,7>::value == 127));
- BOOST_TEST(( boost::low_bits<T,8>::value == 255));
+ BOOST_ASSERT(( boost::low_bits<T,1>::value == ~(~(T(0)) << 1) ));
+ BOOST_ASSERT(( boost::low_bits<T,2>::value == ~(~(T(0)) << 2) ));
+ BOOST_ASSERT(( boost::low_bits<T,3>::value == ~(~(T(0)) << 3) ));
+ BOOST_ASSERT(( boost::low_bits<T,4>::value == ~(~(T(0)) << 4) ));
+ BOOST_ASSERT(( boost::low_bits<T,5>::value == ~(~(T(0)) << 5) ));
+ BOOST_ASSERT(( boost::low_bits<T,6>::value == ~(~(T(0)) << 6) ));
+ BOOST_ASSERT(( boost::low_bits<T,7>::value == ~(~(T(0)) << 7) ));
+ // BOOST_ASSERT(( boost::low_bits<T,8>::value == ~(~(T(0)) << 8) ));
// assert that type returns the correct typedef.
- BOOST_TEST(( is_same<
+ BOOST_ASSERT(( is_same<
typename low_bits<T, 3>::type,
low_bits<T, 3> >::value
));
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/test_type_list.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/test_type_list.hpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/test_type_list.hpp 2010-05-15 12:42:22 EDT (Sat, 15 May 2010)
@@ -20,6 +20,7 @@
// boost includes
+#include <boost/assert.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/cstdint.hpp>
#include <boost/mpl/list.hpp>
@@ -27,41 +28,6 @@
using namespace boost;
-/*
-integer types from boost integer:
-
-int_least8_t
-int_least16_t
-int_least32_t
-uint_least8_t
-uint_least16_t
-uint_least32_t
-
-
-The following types are available only if, after including <boost/cstdint.hpp>,
-the macro BOOST_NO_INT64_T is not defined:
-
-int_least64_t
-uint_least64_t
-
-The following fastest minimum-width integer types are provided for all platforms:
-
-int_fast8_t
-int_fast16_t
-int_fast32_t
-uint_fast8_t
-uint_fast16_t
-uint_fast32_t
-
-The following types are available only if, after including <boost/cstdint.hpp>,
-the macro BOOST_NO_INT64_T is not defined:
-
-int_fast64_t
-uint_fast64_t
-
-/////
-typedef low_bits<T, 3> lbits
-*/
// testing type list.
typedef boost::mpl::list<
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