diff options
| author | Martin Hořeňovský | 2021-05-29 11:24:42 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-05-29 13:15:46 +0200 |
| commit | c9027375a3e57b59ecdeba696d3031163e473108 (patch) | |
| tree | 693bbc68a9d70fb1ac7a582f4bb9735f611b9ed0 /src/catch2/catch_session.cpp | |
| parent | 2ae28fc8525813023f8ec0f5318670cfaf86ec83 (diff) | |
| download | catch3-c9027375a3e57b59ecdeba696d3031163e473108.tar.gz | |
Replace std::endl with \n and flush
In some places the `std::flush` was not added, as it was sufficiently
obvious that the flush semantics are not intended. There are likely
other places where the flush semantics aren't intended, but that
is a cleanup for later.
Diffstat (limited to 'src/catch2/catch_session.cpp')
| -rw-r--r-- | src/catch2/catch_session.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp index 5b1a50a9..edfef717 100644 --- a/src/catch2/catch_session.cpp +++ b/src/catch2/catch_session.cpp @@ -161,16 +161,16 @@ namespace Catch { void Session::showHelp() const { Catch::cout() - << "\nCatch v" << libraryVersion() << "\n" - << m_cli << std::endl - << "For more detailed usage please see the project docs\n" << std::endl; + << "\nCatch v" << libraryVersion() << '\n' + << m_cli << '\n' + << "For more detailed usage please see the project docs\n\n" << std::flush; } void Session::libIdentify() { Catch::cout() << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n" << std::left << std::setw(16) << "category: " << "testframework\n" << std::left << std::setw(16) << "framework: " << "Catch Test\n" - << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl; + << std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush; } int Session::applyCommandLine( int argc, char const * const * argv ) { @@ -186,7 +186,7 @@ namespace Catch { << "\nError(s) in input:\n" << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; - Catch::cerr() << "Run with -? for usage\n" << std::endl; + Catch::cerr() << "Run with -? for usage\n\n" << std::flush; return MaxExitCode; } @@ -229,12 +229,12 @@ namespace Catch { int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before starting" << std::endl; + Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; static_cast<void>(std::getchar()); } int exitCode = runInternal(); if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl; + Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush; static_cast<void>(std::getchar()); } return exitCode; @@ -296,7 +296,7 @@ namespace Catch { } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { - Catch::cerr() << ex.what() << std::endl; + Catch::cerr() << ex.what() << '\n' << std::flush; return MaxExitCode; } #endif |