diff --git a/example/prg_exec_example.cpp b/example/prg_exec_example.cpp index d1a9d6da..a90f245e 100644 --- a/example/prg_exec_example.cpp +++ b/example/prg_exec_example.cpp @@ -1,10 +1,10 @@ // boost Program Execution Monitor program --------------------------------// - int add( int i, int j ) { return i+j; } int cpp_main( int, char *[] ) // note the name! -{ - // two ways to detect and report the same error: - if ( add(2,2) != 4 ) throw "Oops..."; // #1 throws on error - return add(2,2) == 4 ? 0 : 1; // #2 returns error directly +{ + // two ways to detect and report the same error: + if ( add(2,2) != 4 ) throw "Oops..."; // #1 throws on error + + return add(2,2) == 4 ? 0 : 1; // #2 returns error directly } \ No newline at end of file diff --git a/example/test_exec_example.cpp b/example/test_exec_example.cpp index f0d0ef23..0097732f 100644 --- a/example/test_exec_example.cpp +++ b/example/test_exec_example.cpp @@ -1,24 +1,25 @@ // boost Test Execution Monitor example program ------------------------// +// Boost.Test #include int add( int i, int j ) { return i+j; } 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 + // six ways to detect and report the same error: + BOOST_CHECK( add(2,2) == 4 ); // #1 continues on error - BOOST_REQUIRE( add(2,2) == 4 ); // #2 throws on error + BOOST_REQUIRE( add(2,2) == 4 ); // #2 throws on error - if ( add(2,2) != 4 ) - BOOST_ERROR( "Ouch..."); // #3 continues on error + if ( add(2,2) != 4 ) + BOOST_ERROR( "Ouch..."); // #3 continues on error - if ( add(2,2) != 4 ) - BOOST_FAIL( "Ouch..." ); // #4 throws on error + if ( add(2,2) != 4 ) + BOOST_FAIL( "Ouch..." ); // #4 throws on error - if ( add(2,2) != 4 ) - throw "Oops..."; // #5 throws on error + if ( add(2,2) != 4 ) + throw "Oops..."; // #5 throws on error - return add(2,2) == 4 ? 0 : 1; // #6 returns error code + 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 c8ef5e36..2e8efe11 100644 --- a/example/unit_test_example1.cpp +++ b/example/unit_test_example1.cpp @@ -6,10 +6,11 @@ // // See http://www.boost.org for most recent version including documentation. +// Boost.Test #include using boost::unit_test_framework::test_suite; -// most frequently you implement test cases as a free functions +// most frequently you implement test cases as a free functions void free_test_function() { // reports 'error in "free_test_function": test 2 == 1 failed' @@ -22,8 +23,8 @@ init_unit_test_suite( int argc, char * argv[] ) { // this example will pass cause we now ahead of time number of expected failures test->add( BOOST_TEST_CASE( &free_test_function ), 1 /* expected one error */ ); - - return test; + + return test; } // EOF diff --git a/example/unit_test_example2.cpp b/example/unit_test_example2.cpp index 6209ad91..f5d96327 100644 --- a/example/unit_test_example2.cpp +++ b/example/unit_test_example2.cpp @@ -6,6 +6,7 @@ // // See http://www.boost.org for most recent version including documentation. +// Boost.Test #include using boost::unit_test_framework::test_suite; diff --git a/test/prg_exec_fail2.cpp b/test/prg_exec_fail2.cpp index f71eabf0..92ab1fb3 100644 --- a/test/prg_exec_fail2.cpp +++ b/test/prg_exec_fail2.cpp @@ -17,8 +17,8 @@ int cpp_main( int, char *[] ) // note the name { - int div = 0; - return 10 / div; + int div = 0; + return 10 / div; } //____________________________________________________________________________// @@ -27,6 +27,9 @@ int cpp_main( int, char *[] ) // note the name // Revision History : // // $Log$ +// Revision 1.6 2002/12/09 05:16:50 rogeeff +// *** empty log message *** +// // Revision 1.5 2002/11/02 20:04:43 rogeeff // release 1.29.0 merged into the main trank //