Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61995 - sandbox/SOC/2010/bit_masks/lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-05-15 11:57:53


Author: bbartman
Date: 2010-05-15 11:57:52 EDT (Sat, 15 May 2010)
New Revision: 61995
URL: http://svn.boost.org/trac/boost/changeset/61995

Log:
working on completing a testing framework for my integer stuff as well as fixing some of the things one of my mentor asked me to
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 24 ++++++++++++++++--------
   sandbox/SOC/2010/bit_masks/lib/integer/test/test_type_list.hpp | 37 +++++++++++++++++++------------------
   2 files changed, 35 insertions(+), 26 deletions(-)

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 11:57:52 EDT (Sat, 15 May 2010)
@@ -24,13 +24,21 @@
     // making sure that the value type is transfered correctly.
     BOOST_TEST((is_same< typename low_bits<T, 3>::value_type, T >::value));
 
- // assert that mask is correct.
- // T r = typename ;
- BOOST_TEST(( boost::low_bits<T,3>::value ));
 
- // assert that type returns the correct typedef.
- BOOST_TEST(( is_same< typename low_bits<T, 3>::type, low_bits<T, 3> >::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));
 
+ // assert that type returns the correct typedef.
+ BOOST_TEST(( is_same<
+ typename low_bits<T, 3>::type,
+ low_bits<T, 3> >::value
+ ));
 }
 
 
@@ -44,8 +52,8 @@
 
 
 int main( ) {
- mpl::for_each<test_types>( type_tester() );
- mpl::for_each<test_types_2>( type_tester() );
- mpl::for_each<test_types_3>( type_tester() );
+ mpl::for_each< test_types >( type_tester() );
+ mpl::for_each< test_types_2 >( type_tester() );
+ mpl::for_each< test_types_3 >( type_tester() );
     return 0;
 }

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 11:57:52 EDT (Sat, 15 May 2010)
@@ -18,6 +18,7 @@
 // standard library includes
 #include <cstddef>
 
+
 // boost includes
 #include <boost/cstdint.hpp>
 #include <boost/mpl/list.hpp>
@@ -79,8 +80,8 @@
> test_types;
 
 
-typedef boost::mpl::list<
             // ____________ standard types __________________
+typedef boost::mpl::list<
                             // char16_t,
                             // char32_t,
                             wchar_t,
@@ -90,28 +91,28 @@
                             // std::nullptr_t,
> test_types_2;
 
+ // ____________ Boost cstdint types __________________
 typedef boost::mpl::list<
- // ____________ cstdint types __________________
- int_least8_t,
- int_least16_t,
- int_least32_t,
- uint_least8_t,
- uint_least16_t,
- uint_least32_t,
+ boost::int_least8_t,
+ boost::int_least16_t,
+ boost::int_least32_t,
+ boost::uint_least8_t,
+ boost::uint_least16_t,
+ boost::uint_least32_t,
 #if 0
- int_least64_t,
- uint_least64_t,
+ boost::int_least64_t,
+ boost::uint_least64_t,
 #endif
- int_fast8_t,
- int_fast16_t,
- int_fast32_t,
- uint_fast8_t,
- uint_fast16_t,
- uint_fast32_t
+ boost::int_fast8_t,
+ boost::int_fast16_t,
+ boost::int_fast32_t,
+ boost::uint_fast8_t,
+ boost::uint_fast16_t,
+ boost::uint_fast32_t
 #if 0
                             ,
- int_fast64_t,
- uint_fast64_t
+ boost::int_fast64_t,
+ boost::uint_fast64_t
 #endif
> test_types_3;
 


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