Tools: gcc34, msvc80, msvc71 Date: 2006-03-13 01:16:57.765000
Code:
#include <iostream>
#include <ostream>
#include <iomanip>
#include <limits>
#include <cstdlib>
#include "imp/unsigned_int.hpp"
#define UINT_BITS (std::numeric_limits< unsigned >::digits)
namespace
{
int check_failures = 0;
}
# define CHECK( E ) \
do { if ( !(E) ) \
{ \
std::cerr << __LINE__ << ": " << #E << '\n'; \
++check_failures; \
} \
} while (false)
# define CHECK_PRINT( E, S ) \
do { if ( !(E) ) \
{ \
std::cerr << __LINE__ << ": " << #E << " : " << S << '\n'; \
++check_failures; \
} \
} while (false)
void test()
{
using imp::unsigned_int;
imp::unsigned_int< 128 > variable;
}
int main()
{
bool r = false;
try
{
test();
r = true;
}
catch (std::exception const &e)
{
std::cerr << e.what() << std::endl;
}
catch ( ... )
{
std::cerr << "Exception ...\n";
}
if ( r && !check_failures ) std::cout << "Ok\n";
std::cout.flush();
std::cerr.flush();
return !r || check_failures ? EXIT_FAILURE : EXIT_SUCCESS;
}