From 101237c0b0876f3c2171cbf33e5bca995f051f6c Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 4 Sep 2012 23:55:34 +0200 Subject: [PATCH] Do not use logger as this leads to badly formatted output. --- src/test/GTestSuite.cpp | 22 +++++++++++----------- src/test/GTestSuites.cpp | 14 +++++++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/test/GTestSuite.cpp b/src/test/GTestSuite.cpp index 194390d..d672242 100644 --- a/src/test/GTestSuite.cpp +++ b/src/test/GTestSuite.cpp @@ -262,9 +262,6 @@ bool GTestSuite::run(void) // executed. set(); - // Log name of test suite - m_log << std::endl; - // Initialise success flag bool success = true; @@ -281,7 +278,7 @@ bool GTestSuite::run(void) int old_failures = failures(); // Log the name of the test - m_log << m_names[m_index] << ": "; + std::cout << m_names[m_index] << ": "; // Create a test of error type for function testing GTestCase* test = new GTestCase(GTestCase::ERROR_TEST, m_names[m_index]); @@ -331,14 +328,14 @@ bool GTestSuite::run(void) } // Log the result (".","F" or, "E") - m_log << test->print(); + std::cout << test->print(); // Log if there are errors or failures if ((m_errors == old_errors && m_failures == old_failures)) { - m_log << " ok" << std::endl; + std::cout << " ok" << std::endl; } else { - m_log << " NOK" << std::endl; + std::cout << " NOK" << std::endl; success = false; } @@ -431,7 +428,7 @@ void GTestSuite::test_assert(bool assert, testcase->message(message); // Log the result (".","F" or, "E") - m_log << testcase->print(); + std::cout << testcase->print(); // Add test case to test suite m_tests.push_back(testcase); @@ -495,7 +492,7 @@ void GTestSuite::test_value(const double& value, testcase->message(formated_message); // Log the result (".","F" or, "E") - m_log << testcase->print(); + std::cout << testcase->print(); // Add test case to test suite m_tests.push_back(testcase); @@ -576,7 +573,7 @@ void GTestSuite::test_try_success(void) m_stack_try.pop_back(); // Log the result (".","F" or, "E") - m_log << m_tests.back()->print(); + std::cout << m_tests.back()->print(); // Return return; @@ -639,7 +636,7 @@ void GTestSuite::test_try_failure(const std::string& message, m_stack_try.pop_back(); // Log the result ( ".","F" or, "E") - m_log << m_tests.back()->print(); + std::cout << m_tests.back()->print(); //Return return; @@ -901,6 +898,9 @@ void GTestSuite::free_members(void) delete m_tests[i]; } + // Close logger + m_log.close(); + // Return return; } diff --git a/src/test/GTestSuites.cpp b/src/test/GTestSuites.cpp index cb6f834..2c76505 100644 --- a/src/test/GTestSuites.cpp +++ b/src/test/GTestSuites.cpp @@ -222,10 +222,10 @@ int GTestSuites::size(void) const ***************************************************************************/ void GTestSuites::append(GTestSuite& suite) { - //Add testsuite to container + // Add testsuite to container m_testsuites.push_back(&suite); - //Return + // Return return; } @@ -244,9 +244,10 @@ bool GTestSuites::run(void) std::string frame = fill("*", text.length()); // Log name of test suites - m_log << std::endl << frame; - m_log << std::endl << text; - m_log << std::endl << frame; + std::cout << std::endl; + std::cout << frame << std::endl; + std::cout << text << std::endl; + std::cout << frame << std::endl; // Initialise success flag bool success = true; @@ -472,6 +473,9 @@ void GTestSuites::copy_members(const GTestSuites& suites) ***************************************************************************/ void GTestSuites::free_members(void) { + // Close logger + m_log.close(); + // Return return; } -- libgit2 0.21.4