mirror of
https://github.com/boostorg/conversion.git
synced 2025-08-03 14:34:33 +02:00
fix syntax errors
[SVN r25473]
This commit is contained in:
@@ -28,7 +28,7 @@ using namespace boost;
|
|||||||
using std::cout;
|
using std::cout;
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char * argv[] )
|
int test_main( int argc, char * argv[] )
|
||||||
{
|
{
|
||||||
|
|
||||||
# ifdef NDEBUG
|
# ifdef NDEBUG
|
||||||
@@ -65,36 +65,36 @@ int main( int argc, char * argv[] )
|
|||||||
|
|
||||||
// tests which should result in errors being detected
|
// tests which should result in errors being detected
|
||||||
|
|
||||||
caught_exception = false;
|
bool caught_exception = false;
|
||||||
try { c = numeric_cast<signed char>( large_value ); }
|
try { c = numeric_cast<signed char>( large_value ); }
|
||||||
catch (bad_numeric_cast)
|
catch (bad_numeric_cast)
|
||||||
{ cout<<"caught bad_numeric_cast #1\n"; caught_exception = true; }
|
{ cout<<"caught bad_numeric_cast #1\n"; caught_exception = true; }
|
||||||
BOOST_CHECK ( caught_exception )
|
BOOST_CHECK ( caught_exception );
|
||||||
|
|
||||||
caught_exception = false;
|
caught_exception = false;
|
||||||
try { c = numeric_cast<signed char>( large_negative_value ); }
|
try { c = numeric_cast<signed char>( large_negative_value ); }
|
||||||
catch (bad_numeric_cast)
|
catch (bad_numeric_cast)
|
||||||
{ cout<<"caught bad_numeric_cast #2\n"; caught_exception = true; }
|
{ cout<<"caught bad_numeric_cast #2\n"; caught_exception = true; }
|
||||||
BOOST_CHECK ( caught_exception )
|
BOOST_CHECK ( caught_exception );
|
||||||
|
|
||||||
unsigned long ul;
|
unsigned long ul;
|
||||||
caught_exception = false;
|
caught_exception = false;
|
||||||
try { ul = numeric_cast<unsigned long>( large_negative_value ); }
|
try { ul = numeric_cast<unsigned long>( large_negative_value ); }
|
||||||
catch (bad_numeric_cast)
|
catch (bad_numeric_cast)
|
||||||
{ cout<<"caught bad_numeric_cast #3\n"; caught_exception = true; }
|
{ cout<<"caught bad_numeric_cast #3\n"; caught_exception = true; }
|
||||||
BOOST_CHECK ( caught_exception )
|
BOOST_CHECK ( caught_exception );
|
||||||
|
|
||||||
caught_exception = false;
|
caught_exception = false;
|
||||||
try { ul = numeric_cast<unsigned long>( small_negative_value ); }
|
try { ul = numeric_cast<unsigned long>( small_negative_value ); }
|
||||||
catch (bad_numeric_cast)
|
catch (bad_numeric_cast)
|
||||||
{ cout<<"caught bad_numeric_cast #4\n"; caught_exception = true; }
|
{ cout<<"caught bad_numeric_cast #4\n"; caught_exception = true; }
|
||||||
BOOST_CHECK ( caught_exception )
|
BOOST_CHECK ( caught_exception );
|
||||||
|
|
||||||
caught_exception = false;
|
caught_exception = false;
|
||||||
try { numeric_cast<int>( DBL_MAX ); }
|
try { numeric_cast<int>( DBL_MAX ); }
|
||||||
catch (bad_numeric_cast)
|
catch (bad_numeric_cast)
|
||||||
{ cout<<"caught bad_numeric_cast #5\n"; caught_exception = true; }
|
{ cout<<"caught bad_numeric_cast #5\n"; caught_exception = true; }
|
||||||
BOOST_CHECK ( caught_exception )
|
BOOST_CHECK ( caught_exception );
|
||||||
|
|
||||||
return 0 ;
|
return 0 ;
|
||||||
} // main
|
}
|
||||||
|
Reference in New Issue
Block a user