Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64441 - in sandbox/SOC/2010/bit_masks/lib/integer/test: . bft_testing
From: bbartmanboost_at_[hidden]
Date: 2010-07-29 10:16:28


Author: bbartman
Date: 2010-07-29 10:16:27 EDT (Thu, 29 Jul 2010)
New Revision: 64441
URL: http://svn.boost.org/trac/boost/changeset/64441

Log:
need to rename a test so i'm commiting first
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/test/Jamfile.v2 | 1 +
   sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/cls_ctz_tests.cpp | 37 +++++++++++++++++++++++++++++++++++++
   2 files changed, 38 insertions(+), 0 deletions(-)

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-29 10:16:27 EDT (Thu, 29 Jul 2010)
@@ -61,5 +61,6 @@
         [ run bft_testing/variadic_sequence_40_test.cpp ]
         [ run bft_testing/variadic_sequence_50_test.cpp ]
         [ run bft_testing/interface_meta_function_test.cpp ]
+ [ run bft_testing/clz_ctz_test.cpp ]
     ;
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/cls_ctz_tests.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/cls_ctz_tests.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bft_testing/cls_ctz_tests.cpp 2010-07-29 10:16:27 EDT (Thu, 29 Jul 2010)
@@ -0,0 +1,37 @@
+// 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)
+
+
+#include <boost/integer/bitfield_tuple.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+using namespace boost;
+using namespace boost::bitfields;
+using namespace boost::bitfields::detail::pointer_member;
+
+typedef bits_mask< int, 2, bit_width<int>::value - 4> mask_1;
+typedef bits_mask< int, 4, bit_width<int>::value - 4> mask_2;
+typedef bits_mask< int, 0, bit_width<int>::value - 4> mask_2;
+int main() {
+ // count leading zeros' test
+ {
+ // count_leading_zeros
+ BOOST_TEST( count_leading_zeros<mask_1>::value == 2);
+ BOOST_TEST( count_leading_zeros<mask_2>::value == 0);
+ BOOST_TEST( count_leading_zeros<mask_3>::value == 4);
+ }
+
+ // count trailing zeros' test
+ {
+ // count_trailing_zeros
+ BOOST_TEST( count_trailing_zeros<mask_1>::value == 2);
+ BOOST_TEST( count_trailing_zeros<mask_2>::value == 4);
+ BOOST_TEST( count_trailing_zeros<mask_3>::value == 0);
+
+ }
+ return boost::report_errors();
+}
+


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