diff --git a/src/cpp_main.cpp b/src/cpp_main.cpp index d7802f51..328bd864 100644 --- a/src/cpp_main.cpp +++ b/src/cpp_main.cpp @@ -22,21 +22,21 @@ namespace std { using ::getenv; using ::atoi; } #endif -int cpp_main( int argc, char * argv[] ); // prototype for user's cpp_main() +int cpp_main( int argc, char* argv[] ); // prototype for user's cpp_main() namespace { class cpp_main_caller : public boost::execution_monitor { public: - cpp_main_caller( int argc, char ** argv ) + cpp_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {} int function() { return cpp_main( m_argc, m_argv ); } private: int m_argc; - char ** m_argv; + char** m_argv; }; } @@ -45,7 +45,7 @@ private: // ************** cpp main ************** // // ************************************************************************** // -int main( int argc, char * argv[] ) +int main( int argc, char* argv[] ) { cpp_main_caller caller( argc, argv ); diff --git a/src/test_main.cpp b/src/test_main.cpp index 2042dfb1..876a87bd 100644 --- a/src/test_main.cpp +++ b/src/test_main.cpp @@ -69,7 +69,7 @@ int main( int argc, char* argv[] ) { // return code return no_result_code - ? 0 + ? boost::exit_success : ( test_main_result != 0 && test_main_result != boost::exit_success ? test_main_result : unit_test_result::instance().result_code() diff --git a/src/unit_test_main.cpp b/src/unit_test_main.cpp index 407bb13c..f5279105 100644 --- a/src/unit_test_main.cpp +++ b/src/unit_test_main.cpp @@ -99,7 +99,7 @@ main( int argc, char* argv[] ) delete test; // return code - return no_result_code ? 0 : unit_test_result::instance().result_code(); + return no_result_code ? boost::exit_success : unit_test_result::instance().result_code(); } // Revision History diff --git a/src/unit_test_parameters.cpp b/src/unit_test_parameters.cpp index 819c89ff..a46d5852 100644 --- a/src/unit_test_parameters.cpp +++ b/src/unit_test_parameters.cpp @@ -35,7 +35,7 @@ const struct parameter_names { } ; std::string -retrieve_framework_parameter( char const* parameter_name, int* argc, char ** argv ) +retrieve_framework_parameter( char const* parameter_name, int* argc, char** argv ) { // first try to find parameter among command line arguments if present if( argc != NULL ) { diff --git a/src/unit_test_result.cpp b/src/unit_test_result.cpp index a5eba3fc..b2ac5fcb 100644 --- a/src/unit_test_result.cpp +++ b/src/unit_test_result.cpp @@ -13,6 +13,7 @@ // BOOST #include #include +#include // STL #include @@ -49,9 +50,11 @@ struct unit_test_result::Impl { static unit_test_result* m_curr; bool is_failed() { return m_assertions_failed != m_expected_failures || m_exception_caught; } - unit_test_counter result_code() { return is_failed() - ? ( (m_assertions_failed != 0) ? m_assertions_failed : -1 ) - : 0; } + int result_code() { return is_failed() + ? ( (m_assertions_failed != 0) + ? boost::exit_test_failure + : boost::exit_exception_failure ) + : boost::exit_success; } }; boost::scoped_ptr unit_test_result::Impl::m_head;