mirror of
https://github.com/boostorg/integer.git
synced 2025-07-29 12:17:13 +02:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user