mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
Ignore return value of getchar when waiting for keypress
Previously this was causing warnings under MSVC for ignored return value.
This commit is contained in:
parent
cb2fceb119
commit
a7a9be59ff
@ -201,12 +201,12 @@ namespace Catch {
|
|||||||
int run() {
|
int run() {
|
||||||
if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
|
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" << std::endl;
|
||||||
std::getchar();
|
static_cast<void>(std::getchar());
|
||||||
}
|
}
|
||||||
int exitCode = runInternal();
|
int exitCode = runInternal();
|
||||||
if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
|
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 << std::endl;
|
||||||
std::getchar();
|
static_cast<void>(std::getchar());
|
||||||
}
|
}
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user