Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61991 - sandbox/SOC/2010/bit_masks/lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-05-15 09:09:29


Author: bbartman
Date: 2010-05-15 09:09:28 EDT (Sat, 15 May 2010)
New Revision: 61991
URL: http://svn.boost.org/trac/boost/changeset/61991

Log:
working on testing different types
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 66 +++++++++++++++++----------------------
   1 files changed, 29 insertions(+), 37 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 09:09:28 EDT (Sat, 15 May 2010)
@@ -8,23 +8,22 @@
 #include <boost/type_traits.hpp>
 #include <boost/integer/high_low_bits.hpp>
 
-// Testing of low_bits function.
 using namespace boost;
 
-// testing additional integral types.
+/*
 
-// char
-// unsigned char
-// short
-// unsigned short
-// long
-// unsigned long
-// int
-// unsigned int
-// long long
-// unsigned long long
+// testing additional integral types.
+char
+unsigned char
+short
+unsigned short
+long
+unsigned long
+int
+unsigned int
+long long
+unsigned long long
 
-/*
 integer types from boost integer:
 
 int_least8_t
@@ -60,28 +59,21 @@
 typedef low_bits<T, 3> lbits
 */
 
-
-
-// BOOST_AUTO_TEST_CASE( my_test )
-// {
-// BOOST_CHECK_EQUAL( (boost::low_bits<int, 3>::value) , 7 );
-//}
-// BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types )
-// {
-
- // making sure that the value type is transfered correctly.
- // BOOST_CHECK( bool i(is_same< typename low_bits<T, 3>::value_type, T >::value) );
-
- // assert that mask is correct.
- // T r = typename ::;
- // BOOST_CHECK( 1 );
-
- // assert that type returns the correct typedef.
- // BOOST_CHECK( bool i2(is_same< typename low_bits<T, 3>::type, low_bits<T, 3> >::value) );
-// }
-
-typedef boost::mpl::list<int,long,unsigned char> test_types;
-
+// testing type list.
+typedef boost::mpl::list<
+ char,
+ unsigned char,
+ short,
+ unsigned short,
+ long,
+ unsigned long,
+ int,
+ unsigned int
+#if 0
+ long long,
+ unsigned long long
+#endif
+ > test_types;
 
 
 template <typename T>
@@ -96,15 +88,15 @@
 
     // assert that type returns the correct typedef.
     BOOST_ASSERT(( is_same< typename low_bits<T, 3>::type, low_bits<T, 3> >::value ));
+
 }
 
-// basic typedef
-// typedef low_bits<unsigned int, 3> lbits;
 
 struct type_tester {
     template< typename U >
     void operator()(U) {
         test_function<U>();
+
     }
 };
 


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