Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62443 - in sandbox/SOC/2010/bit_masks: boost/integer lib/integer/test
From: bbartmanboost_at_[hidden]
Date: 2010-06-05 10:15:37


Author: bbartman
Date: 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
New Revision: 62443
URL: http://svn.boost.org/trac/boost/changeset/62443

Log:
completed work on renaming of types
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp | 31 -------------------------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp | 17 ++++++++++-------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_test.cpp | 22 +++++++++++-----------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_high_bits_testing.cpp | 30 +++++++++++++++---------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_low_bits_testing.cpp | 30 +++++++++++++++---------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_operator_test.cpp | 32 ++++++++++++++++----------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/compound_mask_test.cpp | 12 ++++++------
   sandbox/SOC/2010/bit_masks/lib/integer/test/high_bit_mask_test.cpp | 24 ++++++++++++------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/low_bit_mask_test.cpp | 22 +++++++++++-----------
   sandbox/SOC/2010/bit_masks/lib/integer/test/mask_check.cpp | 2 +-
   10 files changed, 97 insertions(+), 125 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -15,36 +15,5 @@
 #include <boost/integer/high_bits_mask.hpp>
 #include <boost/integer/low_bits_mask.hpp>
 
-namespace boost {
-
-/** Creates a mask of the supplied width in side type T, from the lower portion
- * of the integer starting from the right most bit moving towards the left.
- */
-template <typename T, unsigned int Width>
-struct low_bits
- :details::low_bits_preconditions<T,Width>,
- integral_mask<T, ~(~T(0) << Width) >
-{
- typedef low_bits<T,Width> type;
-
- BOOST_STATIC_CONSTANT(unsigned int, width = Width);
-};
-
-
-
-/** Creates a mask of the supplied width in side type T, from the lower portion
- * of the integer starting from the left most bit moving towards the right.
- */
-template <typename T, unsigned int Width>
-struct high_bits
- :details::high_bits_preconditions<T,Width>,
- integral_mask<T, ~(~T(0) >> Width) >
-{
- typedef high_bits<T,Width> type;
-
- BOOST_STATIC_CONSTANT(unsigned int, width = Width);
-};
-
-} // namespace boost
 
 #endif

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_group_test.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -9,27 +9,30 @@
 
 struct name_tag { };
 int main() {
- typedef bit_mask_group< named<
- name_tag,low_bits<int,9> >,
- bit_mask<int,3,9>
+ typedef bit_mask_group<
+ named<
+ name_tag,
+ low_bits_mask<int,9>
+ >,
+ bits_mask<int,3,9>
> testing_type1;
 
     BOOST_ASSERT(( sizeof(testing_type1) == 1 ));
 
- BOOST_ASSERT(( testing_type1().get< 0 >() == low_bits<int,9>() ));
- BOOST_ASSERT(( testing_type1().get< name_tag >() == low_bits<int,9>() ));
+ BOOST_ASSERT(( testing_type1().get< 0 >() == low_bits_mask<int,9>() ));
+ BOOST_ASSERT(( testing_type1().get< name_tag >() == low_bits_mask<int,9>() ));
 
     BOOST_ASSERT((
         is_same<
             testing_type1::get_by_index<0>::type,
- low_bits<int,9>
+ low_bits_mask<int,9>
>::value
     ));
 
     BOOST_ASSERT((
         is_same<
             testing_type1::get_by_name< name_tag >::type,
- low_bits<int,9>
+ low_bits_mask<int,9>
>::value
     ));
     

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bit_mask_test.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -3,30 +3,30 @@
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/integer/bit_mask.hpp>
+#include <boost/integer/bits_mask.hpp>
 #include "test_type_list.hpp"
 
 template <typename T>
 void test_function() {
     // making sure that the value type is transfered correctly.
- BOOST_ASSERT((is_same< typename bit_mask<T, 3>::value_type, T >::value));
+ BOOST_ASSERT((is_same< typename bits_mask<T, 3>::value_type, T >::value));
 
     // basic testing only using the offset.
- BOOST_ASSERT(( boost::bit_mask<T,0>::value == 1 ));
- BOOST_ASSERT(( boost::bit_mask<T,1>::value == 2 ));
- BOOST_ASSERT(( boost::bit_mask<T,2>::value == 4 ));
- BOOST_ASSERT(( boost::bit_mask<T,3>::value == 8 ));
- BOOST_ASSERT(( boost::bit_mask<T,4>::value == 16 ));
+ BOOST_ASSERT(( boost::bits_mask<T,0>::value == 1 ));
+ BOOST_ASSERT(( boost::bits_mask<T,1>::value == 2 ));
+ BOOST_ASSERT(( boost::bits_mask<T,2>::value == 4 ));
+ BOOST_ASSERT(( boost::bits_mask<T,3>::value == 8 ));
+ BOOST_ASSERT(( boost::bits_mask<T,4>::value == 16 ));
 
 
     // testing using offset + width.
- BOOST_ASSERT(( boost::bit_mask<T,3,2>::value == 24 ));
- BOOST_ASSERT(( boost::bit_mask<T,2,3>::value == 28 ));
+ BOOST_ASSERT(( boost::bits_mask<T,3,2>::value == 24 ));
+ BOOST_ASSERT(( boost::bits_mask<T,2,3>::value == 28 ));
 
     // assert that type returns the correct typedef.
     BOOST_ASSERT(( is_same<
- typename bit_mask<T, 3>::type,
- bit_mask<T, 3> >::value
+ typename bits_mask<T, 3>::type,
+ bits_mask<T, 3> >::value
               ));
 }
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_high_bits_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_high_bits_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_high_bits_testing.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -20,33 +20,33 @@
 template <typename T>
 void test_function() {
 
- T mask_value(high_bits<T, 1>::value);
- // operator &(T, high_bits)
- T bit_result = T(0) & high_bits<T, 1>();
+ T mask_value(high_bits_mask<T, 1>::value);
+ // operator &(T, high_bits_mask)
+ T bit_result = T(0) & high_bits_mask<T, 1>();
     BOOST_ASSERT(( bit_result == (T(0) & mask_value) ));
 
- // operator &(high_bits, T)
- bit_result = high_bits<T, 1>() & T(0);
+ // operator &(high_bits_mask, T)
+ bit_result = high_bits_mask<T, 1>() & T(0);
     BOOST_ASSERT(( bit_result == (mask_value & T(0)) ));
     
- // operator |(T, high_bits)
- bit_result = T(0) | high_bits<T, 1>();
+ // operator |(T, high_bits_mask)
+ bit_result = T(0) | high_bits_mask<T, 1>();
     BOOST_ASSERT(( bit_result == ( T(0) | mask_value) ));
     
- // operator |(high_bits, T)
- bit_result = high_bits<T,1>() | T(0);
+ // operator |(high_bits_mask, T)
+ bit_result = high_bits_mask<T,1>() | T(0);
     BOOST_ASSERT(( bit_result == (mask_value | T(0)) ));
 
- // operator ^(high_bits, T)
- bit_result = T(0) ^ high_bits<T,1>();
+ // operator ^(high_bits_mask, T)
+ bit_result = T(0) ^ high_bits_mask<T,1>();
     BOOST_ASSERT(( bit_result == (T(0) ^ mask_value) ));
 
- // operator ^(T, high_bits)
- bit_result = high_bits<T,1>() ^ T(0);
+ // operator ^(T, high_bits_mask)
+ bit_result = high_bits_mask<T,1>() ^ T(0);
     BOOST_ASSERT(( bit_result == ( mask_value ^ T(0)) ));
 
- // operator ~(high_bits)
- bit_result = ~ (high_bits<T,1>());
+ // operator ~(high_bits_mask)
+ bit_result = ~ (high_bits_mask<T,1>());
 
     // this is causing errors with unsigned types.
     mask_value = ~( mask_value );

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_low_bits_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_low_bits_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_low_bits_testing.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -16,34 +16,34 @@
 template <typename T>
 void test_function() {
 
- T mask_value( low_bits<T, 1>::value );
+ T mask_value( low_bits_mask<T, 1>::value );
 
- // operator &(T, low_bits)
- T bit_result = T(0) & low_bits<T, 1>();
+ // operator &(T, low_bits_mask)
+ T bit_result = T(0) & low_bits_mask<T, 1>();
     BOOST_ASSERT(( bit_result == (T(0) & mask_value) ));
 
- // operator &(low_bits, T)
- bit_result = low_bits<T, 1>() & T(0);
+ // operator &(low_bits_mask, T)
+ bit_result = low_bits_mask<T, 1>() & T(0);
     BOOST_ASSERT(( bit_result == (mask_value & T(0)) ));
     
- // operator |(T, low_bits)
- bit_result = T(0) | low_bits<T, 1>();
+ // operator |(T, low_bits_mask)
+ bit_result = T(0) | low_bits_mask<T, 1>();
     BOOST_ASSERT(( bit_result == (T(0) | mask_value) ));
 
- // operator |(T, low_bits)
- bit_result = low_bits<T,1>() | T(0);
+ // operator |(T, low_bits_mask)
+ bit_result = low_bits_mask<T,1>() | T(0);
     BOOST_ASSERT(( bit_result == (mask_value | T(0)) ));
 
- // operator ^(low_bits, T)
- bit_result = T(0) ^ low_bits<T,1>();
+ // operator ^(low_bits_mask, T)
+ bit_result = T(0) ^ low_bits_mask<T,1>();
     BOOST_ASSERT(( bit_result == (T(0) ^ mask_value) ));
 
- // operator ^(T, low_bits)
- bit_result = low_bits<T,1>() ^ T(0);
+ // operator ^(T, low_bits_mask)
+ bit_result = low_bits_mask<T,1>() ^ T(0);
     BOOST_ASSERT(( bit_result == (mask_value ^ T(0)) ));
 
- // operator~(low_bits)
- bit_result = ~ (low_bits<T,1>());
+ // operator~(low_bits_mask)
+ bit_result = ~ (low_bits_mask<T,1>());
     mask_value = ~mask_value;
     BOOST_ASSERT(( bit_result == mask_value ));
 }

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_operator_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_operator_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitwise_operator_test.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -7,7 +7,7 @@
 
 #include "test_type_list.hpp"
 #include <boost/integer/high_low_bits.hpp>
-#include <boost/integer/bit_mask.hpp>
+#include <boost/integer/bits_mask.hpp>
 
 
 
@@ -17,34 +17,34 @@
 template <typename T>
 void test_function() {
 
- T mask_value( bit_mask<T,1>::value );
+ T mask_value( bits_mask<T,1>::value );
 
- // operator &(T, bit_mask)
- T bit_result = T(0) & bit_mask<T, 1>();
+ // operator &(T, bits_mask)
+ T bit_result = T(0) & bits_mask<T, 1>();
     BOOST_ASSERT(( bit_result == (T(0) & mask_value) ));
 
- // operator &(bit_mask, T)
- bit_result = bit_mask<T, 1>() & T(0);
+ // operator &(bits_mask, T)
+ bit_result = bits_mask<T, 1>() & T(0);
     BOOST_ASSERT(( bit_result == (mask_value & T(0)) ));
     
- // operator |(T, bit_mask)
- bit_result = T(0) | bit_mask<T,1>();
+ // operator |(T, bits_mask)
+ bit_result = T(0) | bits_mask<T,1>();
     BOOST_ASSERT(( bit_result == (T(0) | mask_value) ));
 
- // operator |(T, bit_mask)
- bit_result = bit_mask<T,1>() | T(0);
+ // operator |(T, bits_mask)
+ bit_result = bits_mask<T,1>() | T(0);
     BOOST_ASSERT(( bit_result == (mask_value | T(0)) ));
 
- // operator ^(bit_mask, T)
- bit_result = T(0) ^ bit_mask<T,1>();
+ // operator ^(bits_mask, T)
+ bit_result = T(0) ^ bits_mask<T,1>();
     BOOST_ASSERT(( bit_result == (T(0) ^ mask_value) ));
 
- // operator ^(T, bit_mask)
- bit_result = bit_mask<T,1>() ^ T(0);
+ // operator ^(T, bits_mask)
+ bit_result = bits_mask<T,1>() ^ T(0);
     BOOST_ASSERT(( bit_result == (mask_value ^ T(0)) ));
 
- // operator~(bit_mask)
- bit_result = ~ (bit_mask<T,1>());
+ // operator~(bits_mask)
+ bit_result = ~ (bits_mask<T,1>());
     mask_value = ~mask_value;
     BOOST_ASSERT(( bit_result == mask_value ));
 }

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/compound_mask_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/compound_mask_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/compound_mask_test.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -12,21 +12,21 @@
     // first testing section for using compond mask.
     {
         // first test.
- typedef compound_mask< high_bits<int,1> , low_bits<int,1> > combo_mask;
- BOOST_ASSERT(( combo_mask() == (high_bits<int,1>() | low_bits<int,1>()) ));
+ typedef compound_mask< high_bits_mask<int,1> , low_bits_mask<int,1> > combo_mask;
+ BOOST_ASSERT(( combo_mask() == (high_bits_mask<int,1>() | low_bits_mask<int,1>()) ));
 
- typedef compound_mask< combo_mask, bit_mask<int, 3, 5> > combo_mask2;
- BOOST_ASSERT(( combo_mask2() == (combo_mask() | bit_mask<int, 3, 5>() ) ));
+ typedef compound_mask< combo_mask, bits_mask<int, 3, 5> > combo_mask2;
+ BOOST_ASSERT(( combo_mask2() == (combo_mask() | bits_mask<int, 3, 5>() ) ));
         BOOST_ASSERT(( combo_mask2() > 0 )) ;
         
         typedef compound_mask<
                     combo_mask2,
- bit_mask<int,15,10>,
+ bits_mask<int,15,10>,
                     integral_mask<int, 6>
> combo_mask3;
 
         BOOST_ASSERT((combo_mask3() ==
- ( combo_mask2() | bit_mask<int,15,10>() | integral_mask<int, 6>() )
+ ( combo_mask2() | bits_mask<int,15,10>() | integral_mask<int, 6>() )
         ));
 
     }

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-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -5,8 +5,8 @@
 
 
 
-#include "test_type_list.hpp"
 #include <boost/integer/high_low_bits.hpp>
+#include "test_type_list.hpp"
 
 // tesitng for bit width.
 using namespace boost;
@@ -15,22 +15,22 @@
 void test_function() {
 
     // making sure that the value type is transfered correctly.
- BOOST_ASSERT((is_same< typename high_bits<T, 3>::value_type, T >::value));
+ BOOST_ASSERT((is_same< typename high_bits_mask<T, 3>::value_type, T >::value));
 
     
- 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) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,1>::value == ~(~(T(0)) >> 1) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,2>::value == ~(~(T(0)) >> 2) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,3>::value == ~(~(T(0)) >> 3) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,4>::value == ~(~(T(0)) >> 4) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,5>::value == ~(~(T(0)) >> 5) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,6>::value == ~(~(T(0)) >> 6) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,7>::value == ~(~(T(0)) >> 7) ));
+ BOOST_ASSERT(( boost::high_bits_mask<T,8>::value == ~(~(T(0)) >> 8) ));
 
     // assert that type returns the correct typedef.
     BOOST_ASSERT(( is_same<
- typename high_bits<T, 3>::type,
- high_bits<T, 3> >::value
+ typename high_bits_mask<T, 3>::type,
+ high_bits_mask<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-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -17,22 +17,22 @@
 void test_function() {
 
     // making sure that the value type is transfered correctly.
- BOOST_ASSERT((is_same< typename low_bits<T, 3>::value_type, T >::value));
+ BOOST_ASSERT((is_same< typename low_bits_mask<T, 3>::value_type, T >::value));
 
     
- 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) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,1>::value == ~(~(T(0)) << 1) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,2>::value == ~(~(T(0)) << 2) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,3>::value == ~(~(T(0)) << 3) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,4>::value == ~(~(T(0)) << 4) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,5>::value == ~(~(T(0)) << 5) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,6>::value == ~(~(T(0)) << 6) ));
+ BOOST_ASSERT(( boost::low_bits_mask<T,7>::value == ~(~(T(0)) << 7) ));
+ // BOOST_ASSERT(( boost::low_bits_mask<T,8>::value == ~(~(T(0)) << 8) ));
 
     // assert that type returns the correct typedef.
     BOOST_ASSERT(( is_same<
- typename low_bits<T, 3>::type,
- low_bits<T, 3> >::value
+ typename low_bits_mask<T, 3>::type,
+ low_bits_mask<T, 3> >::value
               ));
 }
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/mask_check.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/mask_check.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/mask_check.cpp 2010-06-05 10:15:36 EDT (Sat, 05 Jun 2010)
@@ -3,7 +3,7 @@
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/integer/bit_mask.hpp>
+#include <boost/integer/bits_mask.hpp>
 
 int main() {
     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