Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64676 - sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing
From: bbartmanboost_at_[hidden]
Date: 2010-08-08 07:23:00


Author: bbartman
Date: 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
New Revision: 64676
URL: http://svn.boost.org/trac/boost/changeset/64676

Log:
moved redundant code into single header file and then removed all redundant includes from test files and replaced it with a single header which also contains additioanl macros, functors, functions, tests and other assorted routines which can be used through out the testing process.
Text files modified:
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp | 2
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp | 2
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/mask_creator_test.cpp | 46 --------------------------------
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/member_impl_test.cpp | 2
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/proxy_reference_test.cpp | 4 --
   sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/test_utility.hpp | 56 ++++++++++++++++++++++++++++++++++++++++
   6 files changed, 61 insertions(+), 51 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -5,7 +5,7 @@
 
 
 #include <boost/integer/bitfield_vector.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include "test_utility.hpp"
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_test.cpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -5,7 +5,7 @@
 
 
 #include <boost/integer/bitfield_vector.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include "test_utility.hpp"
 
 int main() {
     return boost::report_errors();

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/mask_creator_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/mask_creator_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/mask_creator_test.cpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -5,57 +5,13 @@
 
 
 #include <boost/integer/detail/bitfield_vector/mask_creator.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include "test_utility.hpp"
 #include <boost/mpl/for_each.hpp>
 #include <boost/type_traits/is_same.hpp>
 
-#include <string>
 
-#include <typeinfo>
 
-#include <iostream>
-#include <iomanip>
 
-#if defined(__GNUC__)
-#include <cstring>
-#include <cxxabi.h>
-#endif
-
-template <typename T>
-std::string typestr() {
-#if defined(__GNUC__)
- std::size_t const BUFSIZE = 8192;
- std::size_t n = BUFSIZE;
- char buf[BUFSIZE];
- abi::__cxa_demangle(typeid(T).name(), buf, &n, 0);
- return std::string(buf, ::strlen(buf));
-#else
- return std::string(typeid(T).name());
-#endif
-}
-
-template <typename T>
-inline std::string typestr(T const&)
-{ return typestr<T>(); }
-
-
-#define BOOST_PRINT_ON_TEST_FAILURE(P1, P2) \
- if(P1 != P2 ) { \
- std::cout << #P1 << ": " << std::hex << std::size_t(P1) << std::endl; \
- std::cout << #P2 << ": " << std::hex << std::size_t(P2) << std::endl; \
- }\
- BOOST_TEST( P1 == P2);
-
-
-
-
-
-struct print_set {
- template<typename T>
- void operator()(T x) {
- std::cout<< x << " ";
- }
-};
 
 using namespace boost::detail;
 int main() {

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/member_impl_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/member_impl_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/member_impl_test.cpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -5,7 +5,7 @@
 
 
 #include <boost/integer/bitfield_vector.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include "test_utility.hpp"
 
 using namespace boost::detail;
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/proxy_reference_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/proxy_reference_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/proxy_reference_test.cpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -5,9 +5,7 @@
 
 
 #include <boost/integer/bitfield_vector.hpp>
-#include <boost/detail/lightweight_test.hpp>
-#include <iostream>
-#include <iomanip>
+#include "test_utility.hpp"
 
 using namespace boost::detail;
 

Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/test_utility.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/test_utility.hpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/test_utility.hpp 2010-08-08 07:22:54 EDT (Sun, 08 Aug 2010)
@@ -0,0 +1,56 @@
+// 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/detail/lightweight_test.hpp>
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <typeinfo>
+#include <cstring>
+
+#if defined(__GNUC__)
+#include <cxxabi.h>
+#endif
+
+#ifndef BOOST_BITFIELD_VECTOR_TESTING_UTILITYIES_HPP
+#define BOOST_BITFIELD_VECTOR_TESTING_UTILITYIES_HPP
+
+
+
+template <typename T>
+std::string typestr() {
+#if defined(__GNUC__)
+ std::size_t const BUFSIZE = 8192;
+ std::size_t n = BUFSIZE;
+ char buf[BUFSIZE];
+ abi::__cxa_demangle(typeid(T).name(), buf, &n, 0);
+ return std::string(buf, ::strlen(buf));
+#else
+ return std::string(typeid(T).name());
+#endif
+}
+
+template <typename T>
+inline std::string typestr(T const&)
+{ return typestr<T>(); }
+
+
+#define BOOST_PRINT_ON_TEST_FAILURE(P1, P2) \
+ if(P1 != P2 ) { \
+ std::cout << #P1 << ": " << std::hex << std::size_t(P1) << std::endl; \
+ std::cout << #P2 << ": " << std::hex << std::size_t(P2) << std::endl; \
+ }\
+ BOOST_TEST( P1 == P2);
+
+
+struct print_mpl_values {
+ template<typename T>
+ void operator()(T x) {
+ std::cout<< x << " ";
+ }
+};
+
+#endif


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