Changed to use the lightweight test framework - we can now test with a much wider range of compilers.

[SVN r57942]
This commit is contained in:
John Maddock
2009-11-26 12:59:39 +00:00
parent ac155d3843
commit b83327861c
7 changed files with 145 additions and 148 deletions

View File

@ -10,7 +10,7 @@
// Revision History
// 23 Sep 2001 Initial version (Daryle Walker)
#include <boost/test/minimal.hpp> // for main
#include <boost/detail/lightweight_test.hpp>
#include <boost/cstdlib.hpp> // for boost::exit_success
#include <boost/integer/integer_mask.hpp> // for boost::high_bit_mask_t, etc.
@ -21,9 +21,9 @@
#pragma warning(disable:4127) // conditional expression is constant
#endif
#define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \
#define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \
(v) >::high_bit == (1ul << (v)) );
#define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \
#define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \
(v) >::high_bit_fast == (1ul << (v)) );
#define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \
PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false)
@ -33,20 +33,20 @@
unsigned long mask = 0;\
if(v > 0)\
{ mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\
BOOST_CHECK( ::boost::low_bits_mask_t< (v) >::sig_bits == mask); \
BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits == mask); \
}while(false);
#define PRIVATE_LOW_BITS_FAST_TEST(v) \
do{ \
unsigned long mask = 0;\
if(v > 0)\
{ mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\
BOOST_CHECK( ::boost::low_bits_mask_t< (v) >::sig_bits_fast == mask);\
BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits_fast == mask);\
}while(false);
#define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \
PRIVATE_LOW_BITS_FAST_TEST(v); } while (false)
int test_main( int, char*[] )
int main( int, char*[] )
{
using std::cout;
using std::endl;