Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64395 - in sandbox/SOC/2010/bit_masks: . boost/integer/detail/bft lib/integer/test lib/integer/test/bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-07-27 15:06:27


Author: bbartman
Date: 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
New Revision: 64395
URL: http://svn.boost.org/trac/boost/changeset/64395

Log:
adding test to make sure that the variadic sequence macros extend up to 50 as expected
Added:
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_20_test.cpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_30_test.cpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_40_test.cpp (contents, props changed)
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_50_test.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parsing_meta_functions.hpp | 22 +++++++++++++++++-----
   sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 5 ++++-
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_testing.cpp | 6 +++---
   sandbox/SOC/2010/bit_masks/notes.txt | 24 +++++++-----------------
   4 files changed, 31 insertions(+), 26 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parsing_meta_functions.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parsing_meta_functions.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parsing_meta_functions.hpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -20,9 +20,17 @@
 namespace boost { namespace bitfields { namespace detail {
 
 /** This is an integral type which is the same size as a pointer on a 32 or 64
- * bit system
+ * bit system.
  */
-typedef mpl::if_c<(4<sizeof(void*)),uint64_t,uint32_t>::type ptr_mask_type;
+typedef mpl::if_c<
+ ( 2 == sizeof(void*)),
+ uint16_t,
+ mpl::if_c<
+ ( 4 == sizeof(void*)),
+ uint32_t,
+ uint64_t
+ >::type
+>::type ptr_mask_type;
 
 namespace pointer_member {
 
@@ -103,9 +111,13 @@
             IndexingMask::offset + 1
>,
         ZeroCount + 1,
- bool(((IndexingMask::value & Mask::value) == 0)
- &&
- bool(mpl::less< mpl::size_t< IndexingMask::offset > , mpl::size_t< bit_width< typename Mask::value_type >::value > >::type::value ))
+ bool(((IndexingMask::value & Mask::value) == 0)
+ &&
+ bool(mpl::less<
+ mpl::size_t< IndexingMask::offset >,
+ mpl::size_t<
+ bit_width< typename Mask::value_type >::value >
+ >::type::value ))
>
 { };
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -55,7 +55,10 @@
         [ run bft_testing/pointer_member_test.cpp ]
         [ run bft_testing/pointer_parsing_meta_function_test.cpp ]
         [ run bft_testing/fails_on_64_bit.cpp ]
-
+ [ run bft_testing/variadic_sequence_20_test.cpp ]
+ [ run bft_testing/variadic_sequence_30_test.cpp ]
+ [ run bft_testing/variadic_sequence_40_test.cpp ]
+ [ run bft_testing/variadic_sequence_50_test.cpp ]
 
     ;
 

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_20_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_20_test.cpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,35 @@
+// Copyright 2010 Brian Bartman.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#define BOOST_BFT_PARAM_COUNT 20
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ storage<std::size_t>,
+ member<int, salmon, 16>,
+ flag<blue>
+> test_tuple;
+
+int main() {
+ test_tuple temp;
+
+ temp.get<blue>() = false;
+ BOOST_TEST(( temp.get<blue>() == false ));
+ return boost::report_errors();
+}

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_30_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_30_test.cpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,35 @@
+// Copyright 2010 Brian Bartman.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#define BOOST_BFT_PARAM_COUNT 30
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ storage<std::size_t>,
+ member<int, salmon, 16>,
+ flag<blue>
+> test_tuple;
+
+int main() {
+ test_tuple temp;
+
+ temp.get<blue>() = false;
+ BOOST_TEST(( temp.get<blue>() == false ));
+ return boost::report_errors();
+}

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_40_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_40_test.cpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,35 @@
+// Copyright 2010 Brian Bartman.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#define BOOST_BFT_PARAM_COUNT 40
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ storage<std::size_t>,
+ member<int, salmon, 16>,
+ flag<blue>
+> test_tuple;
+
+int main() {
+ test_tuple temp;
+
+ temp.get<blue>() = false;
+ BOOST_TEST(( temp.get<blue>() == false ));
+ return boost::report_errors();
+}

Added: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_50_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_50_test.cpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -0,0 +1,35 @@
+// Copyright 2010 Brian Bartman.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#define BOOST_BFT_PARAM_COUNT 50
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+
+struct red;
+struct green;
+struct pink;
+struct blue;
+struct salmon;
+
+typedef bitfield_tuple<
+ member<char,red,4>,
+ member<unsigned char, green,5>,
+ storage<std::size_t>,
+ member<int, salmon, 16>,
+ flag<blue>
+> test_tuple;
+
+int main() {
+ test_tuple temp;
+
+ temp.get<blue>() = false;
+ BOOST_TEST(( temp.get<blue>() == false ));
+ return boost::report_errors();
+}

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_testing.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_testing.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/variadic_sequence_testing.cpp 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -6,7 +6,7 @@
 
 #define BOOST_BFT_PARAM_COUNT 11
 #include <boost/integer/bitfield_tuple.hpp>
-#include <boost/assert.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 
 using namespace boost;
@@ -31,8 +31,8 @@
     test_tuple temp;
 
     temp.get<blue>() = false;
- BOOST_ASSERT(( temp.get<blue>() == false));
- return 0;
+ BOOST_TEST(( temp.get<blue>() == false ));
+ return boost::report_errors();
 }
 
 

Modified: sandbox/SOC/2010/bit_masks/notes.txt
==============================================================================
--- sandbox/SOC/2010/bit_masks/notes.txt (original)
+++ sandbox/SOC/2010/bit_masks/notes.txt 2010-07-27 15:06:25 EDT (Tue, 27 Jul 2010)
@@ -15,29 +15,16 @@
 2) reference_builder.hpp
 3) proxy_reference_policy.hpp
 
-
 4) pointer_parsing_meta_functions.hpp
- a) typedef mpl::if_c<(4<sizeof(void*)),uint64_t,uint32_t>::type ptr_mask_type
- I ) Add support for 16 bit systems. Eventually.
-
 
 5) pointer_packing_policy.hpp
 6) name_lookup.hpp
 7) make_bitfield_tuple.hpp
 8) bitfield_tuple_impl.hpp
-
-
-9) bft_element.hpp
- a) change name to bitfield_element.hpp - eventually.
-
-
+9) bitfield_element.hpp
 10) arg_parse_impl.hpp
 
-
 12) bitfield_iterator.hpp - Fusion Extension
- A) Add OR remove const functions. Fusion may be a non const only
- thing. Other option is to make a const iterator but that could be more
- complex then I'm willing to deal with at the moment.
  
 
 14) bitfield_tuple.hpp
@@ -45,9 +32,11 @@
 16) interface_meta_functions.hpp
 
 
-Test file review
-1) variadic_sequence_testing.cpp
 
+--------------------------------------------------------------------------------
+ Test File Review
+--------------------------------------------------------------------------------
+1) variadic_sequence_testing.cpp
     a) Replicate this test all the way up to 50 at intervals of 10.
     b) Switch to using <boost/detail/lightweight_test.hpp> framework.
     c) Add test to test the limit of the bitfield_tuple so that I can be
@@ -94,7 +83,6 @@
 8) make_bft_testing.cpp
     a) remove test from name.
     b) Change to using the <boost/detail/lightweight_test.hpp> framework.
- c)
 
 9) make_bft_testing.cpp
     a) remove test from name.
@@ -113,6 +101,8 @@
     c) Not sure just how I should test the iterator. This may be good as it
         however that doesn't mean that it should just stay as is. Look into
         other fusion iterator tests.
+*) bitfield_iterator.hpp
+ - Make sure that this works in const situation.
 
 12) fusion_integration_testing.cpp
     a) remove testing from name.


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