Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61948 - sandbox/SOC/2010/bit_masks/lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-05-13 10:44:56


Author: bbartman
Date: 2010-05-13 10:44:55 EDT (Thu, 13 May 2010)
New Revision: 61948
URL: http://svn.boost.org/trac/boost/changeset/61948

Log:
adding a testing file for bit_width meta function
Added:
   sandbox/SOC/2010/bit_masks/lib/integer/test/bit_width_test.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 33 +++++++++++++++++++--------------
   1 files changed, 19 insertions(+), 14 deletions(-)

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bit_width_test.cpp
==============================================================================

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-13 10:44:55 EDT (Thu, 13 May 2010)
@@ -3,29 +3,34 @@
 #include <boost/assert.hpp>
 #include <boost/type_traits.hpp>
 #include <boost/integer/high_low_bits.hpp>
-
-// #include <iostream>
-// #include <fstream>
 // Testing of low_bits function.
-
-
-
-using namespace std;
 using namespace boost;
 
-
+// basic typedef
 typedef low_bits<unsigned int, 3> lbits;
 
 int main() {
- // ofstream log("log.cpp");
- // log << lbits::value << endl;
 
+ // making sure that the value type is transfered correctly.
+ BOOST_ASSERT(( is_same< lbits::value_type, unsigned int >::value ));
 
- // throw(lbits::value);
- // std::cerr << lbits::value << std::endl;
- BOOST_ASSERT(( is_same< lbits::value_type, unsigned int>::value ));
+ // assert that mask is correct.
     BOOST_ASSERT(( lbits::value == 7 ));
- // using namespace std;
+
+ // assert that type returns the correct typedef.
+ BOOST_ASSERT(( is_same<lbits::type, lbits>::value ));
+
+ // testing additional integral types.
+ // char
+ // unsigned char
+ // short
+ // unsigned short
+ // long
+ // unsigned long
+ // int
+ // unsigned int
+ // long long
+ // unsigned long long
     
     return 0;
 }


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