diff --git a/build/boost_test_library.dsw b/build/boost_test_library.dsw index ac21c3b0..a2b07368 100644 --- a/build/boost_test_library.dsw +++ b/build/boost_test_library.dsw @@ -165,7 +165,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name unit_test_framework + Project_Dep_Name test_exec_monitor End Project Dependency }}} @@ -258,6 +258,21 @@ Package=<4> ############################################################################### +Project: "test_fp_comparisons"=".\test_fp_comparisons.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name unit_test_framework + End Project Dependency +}}} + +############################################################################### + Project: "test_tools_test"=".\test_tools_test.dsp" - Package Owner=<4> Package=<5> diff --git a/build/minimal_test.dsp b/build/minimal_test.dsp index 7138d614..863a8c51 100644 --- a/build/minimal_test.dsp +++ b/build/minimal_test.dsp @@ -25,7 +25,7 @@ CFG=minimal_test - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=xicl6.exe +CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "minimal_test - Win32 Release" @@ -47,7 +47,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=xilink6.exe +LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 @@ -66,13 +66,12 @@ LINK32=xilink6.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\.." /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /YX /FD /GZ /c -# SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=xilink6.exe +LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Debug" diff --git a/build/test_fp_comparisons.dsp b/build/test_fp_comparisons.dsp new file mode 100644 index 00000000..22400b1e --- /dev/null +++ b/build/test_fp_comparisons.dsp @@ -0,0 +1,105 @@ +# Microsoft Developer Studio Project File - Name="test_fp_comparisons" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=test_fp_comparisons - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "test_fp_comparisons.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "test_fp_comparisons.mak" CFG="test_fp_comparisons - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "test_fp_comparisons - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "test_fp_comparisons - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "test_fp_comparisons - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "test_fp_comparisons - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "c:\temp\boost_test_library\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\.." /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib unit_test_framework.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Debug" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds="Debug\test_fp_comparisons.exe" --result_code=no --report_level=no +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "test_fp_comparisons - Win32 Release" +# Name "test_fp_comparisons - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\test\test_fp_comparisons.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/example/prg_exec_example.cpp b/example/prg_exec_example.cpp index a90f245e..0ea3ef7b 100644 --- a/example/prg_exec_example.cpp +++ b/example/prg_exec_example.cpp @@ -1,4 +1,4 @@ -// boost Program Execution Monitor program --------------------------------// +// boost Program Execution Monitor example program -------------------------// int add( int i, int j ) { return i+j; } int cpp_main( int, char *[] ) // note the name! diff --git a/example/test_exec_example.cpp b/example/test_exec_example.cpp index 0097732f..9d45b1f7 100644 --- a/example/test_exec_example.cpp +++ b/example/test_exec_example.cpp @@ -5,7 +5,7 @@ int add( int i, int j ) { return i+j; } -int test_main( int, char *[] ) // note the name! +int test_main( int, char* [] ) // note the name! { // six ways to detect and report the same error: BOOST_CHECK( add(2,2) == 4 ); // #1 continues on error @@ -13,13 +13,13 @@ int test_main( int, char *[] ) // note the name! BOOST_REQUIRE( add(2,2) == 4 ); // #2 throws on error if ( add(2,2) != 4 ) - BOOST_ERROR( "Ouch..."); // #3 continues on error + BOOST_ERROR( "Ouch..."); // #3 continues on error if ( add(2,2) != 4 ) - BOOST_FAIL( "Ouch..." ); // #4 throws on error + BOOST_FAIL( "Ouch..." ); // #4 throws on error if ( add(2,2) != 4 ) - throw "Oops..."; // #5 throws on error + throw "Oops..."; // #5 throws on error return add(2,2) == 4 ? 0 : 1; // #6 returns error code } diff --git a/example/unit_test_example1.cpp b/example/unit_test_example1.cpp index 2e8efe11..44d17eed 100644 --- a/example/unit_test_example1.cpp +++ b/example/unit_test_example1.cpp @@ -21,7 +21,7 @@ test_suite* init_unit_test_suite( int argc, char * argv[] ) { test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); - // this example will pass cause we now ahead of time number of expected failures + // this example will pass cause we know ahead of time number of expected failures test->add( BOOST_TEST_CASE( &free_test_function ), 1 /* expected one error */ ); return test; diff --git a/example/unit_test_example4.cpp b/example/unit_test_example4.cpp index a275447b..5c876aec 100644 --- a/example/unit_test_example4.cpp +++ b/example/unit_test_example4.cpp @@ -25,7 +25,7 @@ namespace { } test_suite* -init_unit_test_suite( int argc, char * argv[] ) { +init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) { test_suite* test= BOOST_TEST_SUITE( "Unit test example 4" ); test->add( BOOST_PARAM_TEST_CASE( &check_string, (std::string const*)params, params+3 ), 1 ); diff --git a/test/Jamfile b/test/Jamfile index 7643f8ba..fb9580e7 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -4,11 +4,11 @@ subproject libs/test/test ; SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; include testing.jam ; -rule test-btl-lib ( test-rule : test-name : lib-name ? ) +rule test-btl-lib ( test-rule : test-name : lib-name ? : pattern_file ? ) { return [ $(test-rule) $(test-name).cpp ../build/$(lib-name) - : #args - : #input-files + : --save_pattern=yes + : $(pattern_file) : on <*>-w-8080 # requirements ] ; } @@ -27,12 +27,13 @@ test-suite "test_exec_monitor_test" ; test-suite "unit_test_framework_test" - : [ test-btl-lib run : errors_handling_test : boost_test_exec_monitor ] + : [ test-btl-lib run : errors_handling_test : boost_test_exec_monitor : errors_handling_test.pattern ] [ test-btl-lib run : online_test ] [ test-btl-lib run-fail : minimal_test ] [ test-btl-lib run : output_test_stream_test : boost_unit_test_framework ] - [ test-btl-lib run : result_report_test : boost_test_exec_monitor ] + [ test-btl-lib run : result_report_test : boost_test_exec_monitor : result_report_test.pattern ] [ test-btl-lib run : parameterized_test_test : boost_test_exec_monitor ] + [ test-btl-lib run : test_fp_comparisons : boost_unit_test_framework ] [ test-btl-lib run : test_tools_test : boost_unit_test_framework ] [ test-btl-lib run : auto_unit_test_test : boost_unit_test_framework ] [ test-btl-lib run : unit_test_suite_ex_test : boost_unit_test_framework ] diff --git a/test/errors_handling_test.cpp b/test/errors_handling_test.cpp index 2933e92c..7b2a7e47 100644 --- a/test/errors_handling_test.cpp +++ b/test/errors_handling_test.cpp @@ -147,16 +147,18 @@ test_main( int argc, char * argv[] ) { bool match_or_save = retrieve_framework_parameter( SAVE_TEST_PATTERN, &argc, argv ) != "yes"; - output_test_stream output( "error_handling_test.pattern", match_or_save ); + std::string pattern_file_name( argc > 1 ? argv[1] : "errors_handling_test.pattern" ); + + output_test_stream output( pattern_file_name, match_or_save ); unit_test_log::instance().set_log_stream( output ); boost::shared_ptr bad_test_instance( new bad_test ); // for each log level - for( report_level level = report_successful_tests; - level <= report_nothing; - level = static_cast(level+1) ) + for( log_level level = log_successful_tests; + level <= log_nothing; + level = static_cast(level+1) ) { unit_test_log::instance().set_log_threshold_level( level ); @@ -207,12 +209,13 @@ test_main( int argc, char * argv[] ) { unit_test_result_saver saver; - unit_test_log::instance().start( 1 ); + unit_test_log::instance().start(); + unit_test_log::instance().header( 1 ); test.run(); - unit_test_log::instance() << report_progress(); + unit_test_log::instance().finish( 1 ); } - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); BOOST_CHECK( output.match_pattern() ); unit_test_log::instance().set_log_threshold_level( level ); } @@ -231,6 +234,9 @@ test_main( int argc, char * argv[] ) // Revision History : // // $Log$ +// Revision 1.10 2003/02/13 08:47:05 rogeeff +// *** empty log message *** +// // Revision 1.9 2002/12/09 05:14:45 rogeeff // switch to use unit_test_result_saver for internal testing // diff --git a/test/error_handling_test.pattern b/test/errors_handling_test.pattern similarity index 76% rename from test/error_handling_test.pattern rename to test/errors_handling_test.pattern index 76cde0d0..a8230d7e 100644 --- a/test/error_handling_test.pattern +++ b/test/errors_handling_test.pattern @@ -3,665 +3,569 @@ log level: 0; error type: no error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: no error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: no error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: no error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: user error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) errors_handling_test.cpp(56): error in "bad_function": error_on_demand() BOOST_ERROR -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: user error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) errors_handling_test.cpp(56): error in "bad_test::test": error_on_demand() BOOST_ERROR -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: user error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) errors_handling_test.cpp(56): error in "bad_function_param": error_on_demand() BOOST_ERROR -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: user error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) errors_handling_test.cpp(56): error in "bad_test::test_param": error_on_demand() BOOST_ERROR -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: cpp exception; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) Exception in "bad_function": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: cpp exception; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) Exception in "bad_test::test": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: cpp exception; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) Exception in "bad_function_param": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: cpp exception; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) Exception in "bad_test::test_param": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: system error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: system error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: system error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: system error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal user error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) errors_handling_test.cpp(61): fatal error in "bad_function": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal user error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) errors_handling_test.cpp(61): fatal error in "bad_test::test": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal user error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) errors_handling_test.cpp(61): fatal error in "bad_function_param": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal user error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal system error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -Leaving test case "bad_function" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +Leaving test case "bad_function" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal system error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -Leaving test case "bad_test::test" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +Leaving test case "bad_test::test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal system error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -Leaving test case "bad_function_param" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +Leaving test case "bad_function_param" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 0; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -Leaving test case "bad_test::test_param" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +Leaving test case "bad_test::test_param" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 1; error type: no error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: no error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: no error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: no error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) error_on_demand() BOOST_MESSAGE -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: user error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) errors_handling_test.cpp(56): error in "bad_function": error_on_demand() BOOST_ERROR -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: user error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) errors_handling_test.cpp(56): error in "bad_test::test": error_on_demand() BOOST_ERROR -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: user error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) errors_handling_test.cpp(56): error in "bad_function_param": error_on_demand() BOOST_ERROR -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: user error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) errors_handling_test.cpp(56): error in "bad_test::test_param": error_on_demand() BOOST_ERROR -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: cpp exception; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) Exception in "bad_function": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: cpp exception; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) Exception in "bad_test::test": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: cpp exception; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) Exception in "bad_function_param": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: cpp exception; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) Exception in "bad_test::test_param": std::runtime_error: test std::runtime error what() message errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_error -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: system error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: system error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: system error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: system error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal user error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) errors_handling_test.cpp(61): fatal error in "bad_function": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_function" -Leaving test case "Errors handling test" +Leaving test case "bad_function" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal user error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) errors_handling_test.cpp(61): fatal error in "bad_test::test": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_test::test" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal user error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) errors_handling_test.cpp(61): fatal error in "bad_function_param": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_function_param" -Leaving test case "Errors handling test" +Leaving test case "bad_function_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal user error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_demand() BOOST_CRITICAL_ERROR -Leaving test case "bad_test::test_param" -Leaving test case "Errors handling test" +Leaving test case "bad_test::test_param" +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal system error; test case type: free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function" (free function) -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -Leaving test case "bad_function" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +Leaving test case "bad_function" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal system error; test case type: user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test" (user test case) -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -Leaving test case "bad_test::test" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +Leaving test case "bad_test::test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal system error; test case type: parameterized free function; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_function_param" (parameterized free function) -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -Leaving test case "bad_function_param" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +Leaving test case "bad_function_param" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== log level: 1; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... - -Entering test case "Errors handling test" - +Entering test suite "Errors handling test" Entering test case "bad_test::test_param" (parameterized user test case) -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -Leaving test case "bad_test::test_param" -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted -Leaving test case "Errors handling test" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +Leaving test case "bad_test::test_param" +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted +Leaving test suite "Errors handling test" =========================== @@ -756,7 +660,7 @@ errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_ log level: 2; error type: system error; test case type: free function; Running 1 test case... (free function) -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -764,7 +668,7 @@ errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero log level: 2; error type: system error; test case type: user test case; Running 1 test case... (user test case) -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -772,7 +676,7 @@ errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero log level: 2; error type: system error; test case type: parameterized free function; Running 1 test case... (parameterized free function) -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -780,7 +684,7 @@ errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero log level: 2; error type: system error; test case type: parameterized user test case; Running 1 test case... (parameterized user test case) -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -816,40 +720,40 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 2; error type: fatal system error; test case type: free function; Running 1 test case... (free function) -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 2; error type: fatal system error; test case type: user test case; Running 1 test case... (user test case) -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 2; error type: fatal system error; test case type: parameterized free function; Running 1 test case... (parameterized free function) -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 2; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... (parameterized user test case) -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== @@ -927,28 +831,28 @@ errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_ log level: 3; error type: system error; test case type: free function; Running 1 test case... -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 3; error type: system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 3; error type: system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 3; error type: system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -979,37 +883,37 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 3; error type: fatal system error; test case type: free function; Running 1 test case... -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 3; error type: fatal system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 3; error type: fatal system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 3; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== @@ -1087,28 +991,28 @@ errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_ log level: 4; error type: system error; test case type: free function; Running 1 test case... -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 4; error type: system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 4; error type: system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 4; error type: system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -1139,37 +1043,37 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 4; error type: fatal system error; test case type: free function; Running 1 test case... -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 4; error type: fatal system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 4; error type: fatal system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 4; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== @@ -1243,28 +1147,28 @@ errors_handling_test.cpp(67) : last checkpoint: error_on_demand() throw runtime_ log level: 5; error type: system error; test case type: free function; Running 1 test case... -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 5; error type: system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 5; error type: system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 5; error type: system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -1295,37 +1199,37 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 5; error type: fatal system error; test case type: free function; Running 1 test case... -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 5; error type: fatal system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 5; error type: fatal system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 5; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== @@ -1391,28 +1295,28 @@ Running 1 test case... log level: 6; error type: system error; test case type: free function; Running 1 test case... -Exception in "bad_function": integer divide by zero +Exception in "bad_function": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 6; error type: system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": integer divide by zero +Exception in "bad_test::test": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 6; error type: system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": integer divide by zero +Exception in "bad_function_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== log level: 6; error type: system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": integer divide by zero +Exception in "bad_test::test_param": signal: SIGFPE (arithmetic exception) errors_handling_test.cpp(72) : last checkpoint: error_on_demand() divide by zero =========================== @@ -1443,37 +1347,37 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 6; error type: fatal system error; test case type: free function; Running 1 test case... -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 6; error type: fatal system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 6; error type: fatal system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 6; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== @@ -1583,37 +1487,37 @@ errors_handling_test.cpp(61): fatal error in "bad_test::test_param": error_on_de log level: 7; error type: fatal system error; test case type: free function; Running 1 test case... -Exception in "bad_function": memory access violation +Exception in "bad_function": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 7; error type: fatal system error; test case type: user test case; Running 1 test case... -Exception in "bad_test::test": memory access violation +Exception in "bad_test::test": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 7; error type: fatal system error; test case type: parameterized free function; Running 1 test case... -Exception in "bad_function_param": memory access violation +Exception in "bad_function_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_function_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_function_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== log level: 7; error type: fatal system error; test case type: parameterized user test case; Running 1 test case... -Exception in "bad_test::test_param": memory access violation +Exception in "bad_test::test_param": signal: memory access violation errors_handling_test.cpp(77) : last checkpoint: error_on_demand() write to an invalid address -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "bad_test::test_param": testing aborted -..\..\..\libs\test\build\../src\unit_test_suite.cpp(95): fatal error in "Errors handling test": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "bad_test::test_param": testing aborted +../../../libs/test/src/unit_test_suite.cpp(107): fatal error in "Errors handling test": testing aborted =========================== diff --git a/test/result_report_test.cpp b/test/result_report_test.cpp index f91c6fa7..0a529cf1 100644 --- a/test/result_report_test.cpp +++ b/test/result_report_test.cpp @@ -44,26 +44,41 @@ void bad_foo() { //____________________________________________________________________________// -void check( output_test_stream& output ) +void check( output_test_stream& output, std::string const& report_format ) { + unit_test_result::instance().set_report_format( report_format ); + unit_test_result::instance().confirmation_report( output ); + output << "*************************************************************************\n\n"; BOOST_CHECK( output.match_pattern() ); unit_test_result::instance().short_report( output ); + output << "*************************************************************************\n\n"; BOOST_CHECK( output.match_pattern() ); unit_test_result::instance().detailed_report( output ); + output << "*************************************************************************\n\n"; BOOST_CHECK( output.match_pattern() ); } //____________________________________________________________________________// +void check( output_test_stream& output ) +{ + check( output, "HRF" ); + check( output, "XML" ); +} + +//____________________________________________________________________________// + int -test_main( int argc, char * argv[] ) +test_main( int argc, char* argv[] ) { bool match_or_save = retrieve_framework_parameter( SAVE_TEST_PATTERN, &argc, argv ) != "yes"; - output_test_stream output( "result_report_test.pattern", match_or_save ); - + std::string pattern_file_name( argc > 1 ? argv[1] : "result_report_test.pattern" ); + + output_test_stream output( pattern_file_name, match_or_save ); + test_suite* ts_0 = BOOST_TEST_SUITE( "0 test cases inside" ); test_suite* ts_1 = BOOST_TEST_SUITE( "1 test cases inside" ); @@ -112,6 +127,12 @@ test_main( int argc, char * argv[] ) check( output ); + std::string output_format = retrieve_framework_parameter( OUTPUT_FORMAT, &argc, argv ); + + if( output_format.empty() ) { + unit_test_result::set_report_format( retrieve_framework_parameter( REPORT_FORMAT, &argc, argv ) ); + } + return 0; } @@ -121,6 +142,9 @@ test_main( int argc, char * argv[] ) // Revision History : // // $Log$ +// Revision 1.7 2003/02/13 08:47:07 rogeeff +// *** empty log message *** +// // Revision 1.6 2002/11/02 20:04:43 rogeeff // release 1.29.0 merged into the main trank // diff --git a/test/result_report_test.pattern b/test/result_report_test.pattern index b1a1de92..53c1bd95 100644 --- a/test/result_report_test.pattern +++ b/test/result_report_test.pattern @@ -1,75 +1,171 @@ *** No errors detected +************************************************************************* + Test case "call_test_main" passed with: 1 assertion out of 1 passed 0 assertions out of 1 failed +************************************************************************* + Test case "call_test_main" passed with: 2 assertions out of 2 passed 0 assertions out of 2 failed +************************************************************************* + + + + + +************************************************************************* + + + + + + +************************************************************************* + + + + + + +************************************************************************* + *** No errors detected +************************************************************************* -Test case "call_test_main" passed with: -4 assertions out of 4 passed -0 assertions out of 4 failed - -Test case "call_test_main" passed with: -5 assertions out of 5 passed -0 assertions out of 5 failed - - Test case "0 test cases inside" passed with: - 0 assertions out of 0 passed - 0 assertions out of 0 failed - -*** No errors detected Test suite "call_test_main" passed with: -2 test cases out of 2 passed -0 test cases out of 2 failed 7 assertions out of 7 passed 0 assertions out of 7 failed +************************************************************************* + Test suite "call_test_main" passed with: -2 test cases out of 2 passed -0 test cases out of 2 failed 8 assertions out of 8 passed 0 assertions out of 8 failed Test case "0 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed +************************************************************************* - Test case "1 test cases inside" passed with: + + + + +************************************************************************* + + + + + + +************************************************************************* + + + + + + + + + +************************************************************************* + + +*** No errors detected +************************************************************************* + + +Test suite "call_test_main" passed with: +2 test cases out of 2 passed +0 test cases out of 2 failed +13 assertions out of 13 passed + 0 assertions out of 13 failed +************************************************************************* + + +Test suite "call_test_main" passed with: +2 test cases out of 2 passed +0 test cases out of 2 failed +14 assertions out of 14 passed + 0 assertions out of 14 failed + + Test case "0 test cases inside" passed with: + 0 assertions out of 0 passed + 0 assertions out of 0 failed + + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed Test case "good_foo" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed +************************************************************************* + + + + + +************************************************************************* + + + + + + + +************************************************************************* + + + + + + + + + + + + + + + + +************************************************************************* + *** No errors detected +************************************************************************* + Test suite "call_test_main" passed with: 4 test cases out of 4 passed 0 test cases out of 4 failed -10 assertions out of 11 passed - 1 assertion out of 11 failed +19 assertions out of 20 passed + 1 assertion out of 20 failed while 1 failure expected +************************************************************************* + Test suite "call_test_main" passed with: 4 test cases out of 4 passed 0 test cases out of 4 failed -11 assertions out of 12 passed - 1 assertion out of 12 failed +20 assertions out of 21 passed + 1 assertion out of 21 failed while 1 failure expected Test case "0 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed - Test case "1 test cases inside" passed with: + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed @@ -92,28 +188,75 @@ while 1 failure expected 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected +************************************************************************* + + + + + +************************************************************************* + + + + + + + +************************************************************************* + + + + + + + + + + + + + + + + + + + + + + + + + + +************************************************************************* + *** No errors detected +************************************************************************* + Test suite "call_test_main" passed with: 5 test cases out of 5 passed 0 test cases out of 5 failed -13 assertions out of 15 passed - 2 assertions out of 15 failed +25 assertions out of 27 passed + 2 assertions out of 27 failed while 2 failures expected +************************************************************************* + Test suite "call_test_main" passed with: 5 test cases out of 5 passed 0 test cases out of 5 failed -14 assertions out of 16 passed - 2 assertions out of 16 failed +26 assertions out of 28 passed + 2 assertions out of 28 failed while 2 failures expected Test case "0 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed - Test case "1 test cases inside" passed with: + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed @@ -137,7 +280,7 @@ while 2 failures expected 1 assertion out of 1 failed while 1 failure expected - Test case "1 bad test cases inside" passed with: + Test suite "1 bad test cases inside" passed with: 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected @@ -146,28 +289,81 @@ while 2 failures expected 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected +************************************************************************* + + + + + +************************************************************************* + + + + + + + +************************************************************************* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +************************************************************************* + *** No errors detected +************************************************************************* + Test suite "call_test_main" passed with: 8 test cases out of 8 passed 0 test cases out of 8 failed -16 assertions out of 19 passed - 3 assertions out of 19 failed +31 assertions out of 34 passed + 3 assertions out of 34 failed while 3 failures expected +************************************************************************* + Test suite "call_test_main" passed with: 8 test cases out of 8 passed 0 test cases out of 8 failed -17 assertions out of 20 passed - 3 assertions out of 20 failed +32 assertions out of 35 passed + 3 assertions out of 35 failed while 3 failures expected Test case "0 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed - Test case "1 test cases inside" passed with: + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed @@ -191,7 +387,7 @@ while 3 failures expected 1 assertion out of 1 failed while 1 failure expected - Test case "1 bad test cases inside" passed with: + Test suite "1 bad test cases inside" passed with: 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected @@ -220,28 +416,94 @@ while 3 failures expected 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected +************************************************************************* + + + + + +************************************************************************* + + + + + + + +************************************************************************* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +************************************************************************* + *** No errors detected +************************************************************************* + Test suite "call_test_main" passed with: 15 test cases out of 15 passed 0 test cases out of 15 failed -19 assertions out of 24 passed - 5 assertions out of 24 failed +37 assertions out of 42 passed + 5 assertions out of 42 failed while 5 failures expected +************************************************************************* + Test suite "call_test_main" passed with: 15 test cases out of 15 passed 0 test cases out of 15 failed -20 assertions out of 25 passed - 5 assertions out of 25 failed +38 assertions out of 43 passed + 5 assertions out of 43 failed while 5 failures expected Test case "0 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed - Test case "1 test cases inside" passed with: + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed @@ -265,7 +527,7 @@ while 5 failures expected 1 assertion out of 1 failed while 1 failure expected - Test case "1 bad test cases inside" passed with: + Test suite "1 bad test cases inside" passed with: 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected @@ -306,7 +568,7 @@ while 5 failures expected 0 assertions out of 0 passed 0 assertions out of 0 failed - Test case "1 test cases inside" passed with: + Test suite "1 test cases inside" passed with: 0 assertions out of 0 passed 0 assertions out of 0 failed @@ -349,3 +611,101 @@ while 5 failures expected 0 assertions out of 1 passed 1 assertion out of 1 failed while 1 failure expected +************************************************************************* + + + + + +************************************************************************* + + + + + + + +************************************************************************* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +************************************************************************* + diff --git a/test/test_exec_fail3.cpp b/test/test_exec_fail3.cpp index be094ec7..82080375 100644 --- a/test/test_exec_fail3.cpp +++ b/test/test_exec_fail3.cpp @@ -17,7 +17,7 @@ // Boost.Test #include -int test_main( int, char *[] ) // note the name +int test_main( int, char*[] ) // note the name { int v = 1; @@ -33,6 +33,9 @@ int test_main( int, char *[] ) // note the name // Revision History : // // $Log$ +// Revision 1.6 2003/02/13 08:47:10 rogeeff +// *** empty log message *** +// // Revision 1.5 2002/11/02 20:04:43 rogeeff // release 1.29.0 merged into the main trank // diff --git a/test/test_fp_comparisons.cpp b/test/test_fp_comparisons.cpp new file mode 100644 index 00000000..d22eaf74 --- /dev/null +++ b/test/test_fp_comparisons.cpp @@ -0,0 +1,218 @@ +// (C) Copyright Gennadiy Rozental 2001-2002. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. +// +// File : $RCSfile$ +// +// Version : $Id$ +// +// Description : tests floating point comparison algorithms +// *************************************************************************** + +// Boost.Test +#include +#include +#include +using namespace boost::unit_test_framework; + +// STL +#include + +//____________________________________________________________________________// + +#define CHECK_TOOL_USAGE( tool_usage, check ) \ +{ \ + boost::test_toolbox::output_test_stream output; \ + \ + unit_test_log::instance().set_log_stream( output ); \ + { unit_test_result_saver saver; \ + tool_usage; \ + } \ + unit_test_log::instance().set_log_stream( std::cout ); \ + BOOST_CHECK( check ); \ +} + +//____________________________________________________________________________// + +#if !defined(__BORLANDC__) +#define CHECK_PATTERN( msg, shift ) \ + (boost::wrap_stringstream().ref() << __FILE__ << "(" << __LINE__ << "): " << msg).str() + +#else + +#define CHECK_PATTERN( msg, shift ) \ + (boost::wrap_stringstream().ref() << __FILE__ << "(" << (__LINE__-shift) << "): " << msg).str() + +#endif +//____________________________________________________________________________// + +template +void +test_BOOST_CHECK_CLOSE( FPT ) { +#undef TEST_CASE_NAME +#define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_CLOSE_all" << "\"" << + unit_test_log::instance().set_log_threshold_level( log_messages ); + + BOOST_MESSAGE( "testing BOOST_CHECK_CLOSE for " << typeid(FPT).name() ); + + +#define BOOST_CHECK_CLOSE_SHOULD_PASS( first, second, e ) \ + fp1 = static_cast(first); \ + fp2 = static_cast(second); \ + epsilon = static_cast(e); \ + \ + CHECK_TOOL_USAGE( \ + BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), \ + output.is_empty() \ + ) + +#define BOOST_CHECK_CLOSE_SHOULD_PASS_N( first, second, num ) \ + fp1 = static_cast(first); \ + fp2 = static_cast(second); \ + \ + CHECK_TOOL_USAGE( \ + BOOST_CHECK_CLOSE( fp1, fp2, (num) ), \ + output.is_empty() \ + ) + +#define BOOST_CHECK_CLOSE_SHOULD_FAIL( first, second, e ) \ + fp1 = static_cast(first); \ + fp2 = static_cast(second); \ + epsilon = static_cast(e); \ + \ + CHECK_TOOL_USAGE( \ + BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), \ + output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" \ + << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 0 ) ) \ + ) + +#define BOOST_CHECK_CLOSE_SHOULD_FAIL_N( first, second, num ) \ + fp1 = static_cast(first); \ + fp2 = static_cast(second); \ + epsilon = num * std::numeric_limits::epsilon()/2; \ + \ + CHECK_TOOL_USAGE( \ + BOOST_CHECK_CLOSE( fp1, fp2, num ), \ + output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" \ + << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 0 ) ) \ + ) + + FPT fp1, fp2, epsilon, tmp; + + BOOST_CHECK_CLOSE_SHOULD_PASS( 1, 1, 0 ); + + BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, 1e-20, 1e-7 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, 1e-30, 1e-7 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, -1e-10, 1e-3 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL( 0.123456, 0.123457, 1e-6 ); + + BOOST_CHECK_CLOSE_SHOULD_PASS( 0.123456, 0.123457, 1e-5 ); + + BOOST_CHECK_CLOSE_SHOULD_FAIL( 0.123456, -0.123457, 1e-5 ); + + BOOST_CHECK_CLOSE_SHOULD_PASS( 1.23456e28, 1.23457e28, 1e-5 ); + + BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.23456e-10, 1.23457e-11, 1e-5 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.111e-10, 1.112e-10, 0.0008999 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.112e-10, 1.111e-10, 0.0008999 ); + + BOOST_CHECK_CLOSE_SHOULD_PASS( 1 , 1.0001, 1.1e-4 ); + BOOST_CHECK_CLOSE_SHOULD_PASS( 1.0002, 1.0001, 1.1e-4 ); + + BOOST_CHECK_CLOSE_SHOULD_FAIL( 1 , 1.0002, 1.1e-4 ); + + BOOST_CHECK_CLOSE_SHOULD_PASS_N( 1, 1+std::numeric_limits::epsilon() / 2, 1 ); + + tmp = static_cast(1e-10); + BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp+tmp, 2e-10, 1+2 ); + + tmp = static_cast(3.1); + BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp*tmp, 9.61, 1+2 ); + + tmp = 11; + tmp /= 10; + BOOST_CHECK_CLOSE_SHOULD_PASS_N( (tmp*tmp-tmp), 11./100, 1+3 ); + BOOST_CHECK_CLOSE_SHOULD_FAIL_N( 100*(tmp*tmp-tmp), 11, 3 ); + + tmp = static_cast(1e15+1e-10); + BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp*tmp+tmp*tmp, 2e30+2e-20+4e5, 3+5 ); + + fp1 = static_cast(1.0001); + fp2 = static_cast(1001.1001); + tmp = static_cast(1.0001); + + for( int i=0; i < 1000; i++ ) + fp1 = fp1 + tmp; + + CHECK_TOOL_USAGE( + BOOST_CHECK_CLOSE( fp1, fp2, 1000 ), + output.is_empty() + ); +} + +void +test_BOOST_CHECK_CLOSE_all() { + test_BOOST_CHECK_CLOSE( (float)0 ); + test_BOOST_CHECK_CLOSE( (double)0 ); + test_BOOST_CHECK_CLOSE( (long double)0 ); + + double fp1 = 1.00000001; + double fp2 = 1.00000002; + double epsilon = 1e-8; + + CHECK_TOOL_USAGE( + BOOST_CHECK_PREDICATE( close_at_tolerance( epsilon, false ), 2, ( fp1, fp2 ) ), + output.is_empty() + ); + + CHECK_TOOL_USAGE( + BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), + output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" + << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 3 ) ) + ); + + fp1 = 1.23456e-10; + fp2 = 1.23457e-10; + epsilon = 8.1e-6; + + CHECK_TOOL_USAGE( + BOOST_CHECK_PREDICATE( close_at_tolerance( epsilon, false ), 2, ( fp1, fp2 ) ), + output.is_empty() + ); + + CHECK_TOOL_USAGE( + BOOST_CHECK_PREDICATE( close_at_tolerance( epsilon ), 2, ( fp1, fp2 ) ), + output.is_equal( CHECK_PATTERN( + "error in " TEST_CASE_NAME ": test close_at_tolerance( epsilon )(fp1, fp2) " + "failed for (" << fp1 << ", " << fp2 << ")\n", 4 ) ) + ); +} + +//____________________________________________________________________________// + +test_suite* +init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) { + test_suite* test = BOOST_TEST_SUITE("FP compare test"); + + test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_CLOSE_all ) ); + + return test; +} + +//____________________________________________________________________________// + +// *************************************************************************** +// Revision History : +// +// $Log$ +// Revision 1.1 2003/02/13 08:47:11 rogeeff +// *** empty log message *** +// + +// *************************************************************************** + +// EOF diff --git a/test/test_tools_test.cpp b/test/test_tools_test.cpp index a0152644..8486e23d 100644 --- a/test/test_tools_test.cpp +++ b/test/test_tools_test.cpp @@ -16,7 +16,6 @@ // Boost.Test #include #include -#include using namespace boost::unit_test_framework; // BOOST @@ -86,7 +85,7 @@ void test_BOOST_CHECK() { #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); CHECK_TOOL_USAGE( BOOST_CHECK( true ), @@ -117,12 +116,12 @@ test_BOOST_CHECK() { output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test i==1 failed\n", 2 ) ) ); - unit_test_log::instance().set_log_threshold_level( report_successful_tests ); + unit_test_log::instance().set_log_threshold_level( log_successful_tests ); CHECK_TOOL_USAGE( BOOST_CHECK( i==2 ), output.is_equal( CHECK_PATTERN( "info: test i==2 passed\n", 2 ) ) ); - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); } //____________________________________________________________________________// @@ -132,7 +131,7 @@ test_BOOST_REQUIRE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_REQUIRE" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE( true ), @@ -151,13 +150,12 @@ test_BOOST_REQUIRE() { false, output.is_equal( CHECK_PATTERN( "fatal error in " TEST_CASE_NAME ": test j > 5 failed\n", 2 ) ) ); - unit_test_log::instance().set_log_threshold_level( report_successful_tests ); + unit_test_log::instance().set_log_threshold_level( log_successful_tests ); CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE( j < 5 ), output.is_equal( CHECK_PATTERN( "info: test j < 5 passed\n", 1 ) ) , false ); - unit_test_log::instance().set_log_threshold_level( report_all_errors ); - + unit_test_log::instance().set_log_threshold_level( log_all_errors ); } //____________________________________________________________________________// @@ -171,7 +169,7 @@ test_BOOST_MESSAGE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_REQUIRE" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_messages ); + unit_test_log::instance().set_log_threshold_level( log_messages ); CHECK_TOOL_USAGE( BOOST_MESSAGE( "still testing" ), @@ -203,7 +201,7 @@ test_BOOST_WARN() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_WARN" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_warnings ); + unit_test_log::instance().set_log_threshold_level( log_warnings ); CHECK_TOOL_USAGE( BOOST_WARN( sizeof(int) == sizeof(short) ), @@ -217,7 +215,7 @@ test_BOOST_WARN() { class bad_func_container : public test_case { public: - bad_func_container() : test_case( "test_BOOST_CHECKPOINT", 1 ) {} + bad_func_container() : test_case( "test_BOOST_CHECKPOINT", true, 1 ) {} void do_run() { throw "some error"; } @@ -228,7 +226,7 @@ test_BOOST_CHECKPOINT() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECKPOINT" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); BOOST_CHECKPOINT( "Going to do a silly things" ); @@ -250,7 +248,7 @@ test_BOOST_WARN_MESSAGE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_WARN_MESSAGE" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_warnings ); + unit_test_log::instance().set_log_threshold_level( log_warnings ); CHECK_TOOL_USAGE( BOOST_WARN_MESSAGE( sizeof(int) == sizeof(short), "memory won't be used efficiently" ), @@ -274,7 +272,7 @@ test_BOOST_CHECK_MESSAGE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_MESSAGE" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); CHECK_TOOL_USAGE( @@ -291,7 +289,7 @@ test_BOOST_REQUIRE_MESSAGE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_REQUIRE_MESSAGE" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE_MESSAGE( false, "Here we should stop" ), @@ -317,7 +315,7 @@ test_BOOST_CHECK_EQUAL() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_EQUAL" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); int i=1; int j=2; @@ -362,119 +360,6 @@ test_BOOST_CHECK_EQUAL() { //____________________________________________________________________________// -template -void -test_BOOST_CHECK_CLOSE( FPT ) { -#undef TEST_CASE_NAME -#define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_CLOSE_all" << "\"" << - unit_test_log::instance().set_log_threshold_level( report_messages ); - - BOOST_MESSAGE( "testing BOOST_CHECK_CLOSE for " << typeid(FPT).name() ); - - -#define BOOST_CHECK_CLOSE_SHOULD_PASS( first, second, e ) \ - fp1 = static_cast(first); \ - fp2 = static_cast(second); \ - epsilon = static_cast(e); \ - \ - CHECK_TOOL_USAGE( \ - BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), \ - output.is_empty() \ - ) - -#define BOOST_CHECK_CLOSE_SHOULD_PASS_N( first, second, num ) \ - fp1 = static_cast(first); \ - fp2 = static_cast(second); \ - \ - CHECK_TOOL_USAGE( \ - BOOST_CHECK_CLOSE( fp1, fp2, (num) ), \ - output.is_empty() \ - ) - -#define BOOST_CHECK_CLOSE_SHOULD_FAIL( first, second, e ) \ - fp1 = static_cast(first); \ - fp2 = static_cast(second); \ - epsilon = static_cast(e); \ - \ - CHECK_TOOL_USAGE( \ - BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), \ - output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" \ - << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 0 ) ) \ - ) - -#define BOOST_CHECK_CLOSE_SHOULD_FAIL_N( first, second, num ) \ - fp1 = static_cast(first); \ - fp2 = static_cast(second); \ - epsilon = num * std::numeric_limits::epsilon()/2; \ - \ - CHECK_TOOL_USAGE( \ - BOOST_CHECK_CLOSE( fp1, fp2, num ), \ - output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" \ - << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 0 ) ) \ - ) - - FPT fp1, fp2, epsilon, tmp; - - BOOST_CHECK_CLOSE_SHOULD_PASS( 1, 1, 0 ); - - BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, 1e-20, 1e-7 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, 1e-30, 1e-7 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL( 0, -1e-10, 1e-3 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL( 0.123456, 0.123457, 1e-6 ); - - BOOST_CHECK_CLOSE_SHOULD_PASS( 0.123456, 0.123457, 1e-5 ); - - BOOST_CHECK_CLOSE_SHOULD_FAIL( 0.123456, -0.123457, 1e-5 ); - - BOOST_CHECK_CLOSE_SHOULD_PASS( 1.23456e28, 1.23457e28, 1e-5 ); - - BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.23456e-10, 1.23457e-11, 1e-5 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.111e-10, 1.112e-10, 0.0008999 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL( 1.112e-10, 1.111e-10, 0.0008999 ); - - BOOST_CHECK_CLOSE_SHOULD_PASS( 1 , 1.0001, 1.1e-4 ); - BOOST_CHECK_CLOSE_SHOULD_PASS( 1.0002, 1.0001, 1.1e-4 ); - - BOOST_CHECK_CLOSE_SHOULD_FAIL( 1 , 1.0002, 1.1e-4 ); - - BOOST_CHECK_CLOSE_SHOULD_PASS_N( 1, 1+std::numeric_limits::epsilon() / 2, 1 ); - - tmp = static_cast(1e-10); - BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp+tmp, 2e-10, 1+2 ); - - tmp = static_cast(3.1); - BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp*tmp, 9.61, 1+2 ); - - tmp = 11; - tmp /= 10; - BOOST_CHECK_CLOSE_SHOULD_PASS_N( (tmp*tmp-tmp), 11./100, 1+3 ); - BOOST_CHECK_CLOSE_SHOULD_FAIL_N( 100*(tmp*tmp-tmp), 11, 3 ); - - tmp = static_cast(1e15+1e-10); - BOOST_CHECK_CLOSE_SHOULD_PASS_N( tmp*tmp+tmp*tmp, 2e30+2e-20+4e5, 3+5 ); - - fp1 = static_cast(1.0001); - fp2 = static_cast(1001.1001); - tmp = static_cast(1.0001); - - for( int i=0; i < 1000; i++ ) - fp1 = fp1 + tmp; - - CHECK_TOOL_USAGE( - BOOST_CHECK_CLOSE( fp1, fp2, 1000 ), - output.is_empty() - ); -} - -void -test_BOOST_CHECK_CLOSE_all() { - test_BOOST_CHECK_CLOSE( (float)0 ); - test_BOOST_CHECK_CLOSE( (double)0 ); - test_BOOST_CHECK_CLOSE( (long double)0 ); -} - -//____________________________________________________________________________// - bool is_even( int i ) { return i%2 == 0; } @@ -509,21 +394,6 @@ test_BOOST_CHECK_PREDICATE() { BOOST_CHECK_PREDICATE( boost::compose_f_gxy( std::ptr_fun( &is_even ), std::ptr_fun( &foo ) ), 2, (i,15) ), output.is_empty() ); - - double fp1 = 1.00000001; - double fp2 = 1.00000002; - double epsilon = 1e-8; - - CHECK_TOOL_USAGE( - BOOST_CHECK_PREDICATE( close_at_tolerance( epsilon, false ), 2, ( fp1, fp2 ) ), - output.is_empty() - ); - - CHECK_TOOL_USAGE( - BOOST_CHECK_CLOSE( fp1, fp2, epsilon ), - output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test fp1 ~= fp2 failed [" - << fp1 << " !~= " << fp2 << " (+/-" << epsilon << ")]\n", 3 ) ) - ); } //____________________________________________________________________________// @@ -533,24 +403,19 @@ test_BOOST_REQUIRE_PREDICATE() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_REQUIRE_PREDICATE" << '\"' << - double fp1; - double fp2; - double epsilon; - - fp1 = 1.23456e-10; - fp2 = 1.23457e-10; - epsilon = 8.1e-6; + int arg1 = 1; + int arg2 = 2; CHECK_CRITICAL_TOOL_USAGE( - BOOST_REQUIRE_PREDICATE( close_at_tolerance( epsilon, false ), 2, ( fp1, fp2 ) ), + BOOST_REQUIRE_PREDICATE( std::less_equal(), 2, ( arg1, arg2 ) ), output.is_empty(), false ); CHECK_CRITICAL_TOOL_USAGE( - BOOST_REQUIRE_PREDICATE( close_at_tolerance( epsilon ), 2, ( fp1, fp2 ) ), + BOOST_REQUIRE_PREDICATE( std::less_equal(), 2, ( arg2, arg1 ) ), false, output.is_equal( CHECK_PATTERN( - "fatal error in " TEST_CASE_NAME ": test close_at_tolerance( epsilon )(fp1, fp2) " - "failed for (" << fp1 << ", " << fp2 << ")\n", 4 ) ) + "fatal error in " TEST_CASE_NAME ": test std::less_equal()(arg2, arg1) " + "failed for (" << arg2 << ", " << arg1 << ")\n", 4 ) ) ); } @@ -561,7 +426,7 @@ test_BOOST_ERROR() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_ERROR" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); CHECK_TOOL_USAGE( BOOST_ERROR( "Fail to miss an error" ), @@ -583,7 +448,7 @@ test_BOOST_CHECK_THROW() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_THROW" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); int i=0; CHECK_TOOL_USAGE( @@ -591,14 +456,33 @@ test_BOOST_CHECK_THROW() { output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": exception my_exception is expected\n", 2 ) ) ); - unit_test_log::instance().set_log_threshold_level( report_successful_tests ); + unit_test_log::instance().set_log_threshold_level( log_successful_tests ); CHECK_TOOL_USAGE( BOOST_CHECK_THROW( throw my_exception(), my_exception ), output.is_equal( CHECK_PATTERN( "info: exception my_exception is caught\n", 2 ) ) ); - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); +} + +//____________________________________________________________________________// + +void +test_BOOST_CHECK_NO_THROW() { +#undef TEST_CASE_NAME +#define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_NO_THROW" << '\"' << + + int i=0; + CHECK_TOOL_USAGE( + BOOST_CHECK_NO_THROW( i++ ), + output.is_empty() + ); + + CHECK_TOOL_USAGE( + BOOST_CHECK_NO_THROW( throw my_exception() ), + output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": exception was thrown by throw my_exception()\n", 2 ) ) + ); } //____________________________________________________________________________// @@ -608,7 +492,7 @@ test_BOOST_CHECK_EQUAL_COLLECTIONS() { #undef TEST_CASE_NAME #define TEST_CASE_NAME << '\"' << "test_BOOST_CHECK_EQUAL_COLLECTIONS" << '\"' << - unit_test_log::instance().set_log_threshold_level( report_all_errors ); + unit_test_log::instance().set_log_threshold_level( log_all_errors ); int pattern [] = { 1, 2, 3, 4, 5, 6, 7 }; @@ -664,8 +548,34 @@ test_BOOST_IS_DEFINED() { //____________________________________________________________________________// +void +test_BOOST_BITWISE_EQUAL() { +#undef TEST_CASE_NAME +#define TEST_CASE_NAME << '\"' << "test_BOOST_BITWISE_EQUAL" << '\"' << + + CHECK_TOOL_USAGE( + BOOST_BITWISE_EQUAL( 0x16, 0x16 ), + output.is_empty() + ); + + CHECK_TOOL_USAGE( + BOOST_BITWISE_EQUAL( (char)0x06, (char)0x16 ), + output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test (char)0x06 =.= (char)0x16 in the position 4 failed\n", 2 ) ) + ); + + CHECK_TOOL_USAGE( + BOOST_BITWISE_EQUAL( (char)0x26, (char)0x04 ), + output.is_equal( + std::string( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test (char)0x26 =.= (char)0x04 in the position 1 failed\n", 4 ) ) + .append( CHECK_PATTERN( "error in " TEST_CASE_NAME ": test (char)0x26 =.= (char)0x04 in the position 5 failed\n", 4 ) ) ) + ); +} + +//____________________________________________________________________________// + + test_suite* -init_unit_test_suite( int argc, char* argv[] ) { +init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) { test_suite* test = BOOST_TEST_SUITE("Test Tools test"); test->add( BOOST_TEST_CASE( &test_BOOST_CHECK ) ); @@ -677,21 +587,14 @@ init_unit_test_suite( int argc, char* argv[] ) { test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_MESSAGE ) ); test->add( BOOST_TEST_CASE( &test_BOOST_REQUIRE_MESSAGE ) ); test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_EQUAL ) ); - test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_CLOSE_all ), -#if defined(__BORLANDC__) || defined(__GNUC__) - 6 -#elif defined (_MSC_VER) - 2 -#else - 0 -#endif -); test->add( BOOST_TEST_CASE( &test_BOOST_ERROR ) ); test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_THROW ) ); + test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_NO_THROW ) ); test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_EQUAL_COLLECTIONS ) ); test->add( BOOST_TEST_CASE( &test_BOOST_IS_DEFINED ) ); test->add( BOOST_TEST_CASE( &test_BOOST_CHECK_PREDICATE ) ); test->add( BOOST_TEST_CASE( &test_BOOST_REQUIRE_PREDICATE ) ); + test->add( BOOST_TEST_CASE( &test_BOOST_BITWISE_EQUAL ) ); return test; } @@ -702,6 +605,9 @@ init_unit_test_suite( int argc, char* argv[] ) { // Revision History : // // $Log$ +// Revision 1.15 2003/02/13 08:47:12 rogeeff +// *** empty log message *** +// // Revision 1.14 2002/12/09 05:18:34 rogeeff // switched to use unit_test_result_saver for internal testing // switched to wrap_stringstream