mirror of
https://github.com/catchorg/Catch2.git
synced 2025-10-04 11:01:08 +02:00
Fixed alternate stream bugs
This commit is contained in:
@@ -92,10 +92,10 @@ namespace Catch {
|
||||
return getCurrentMutableContext();
|
||||
}
|
||||
|
||||
std::streambuf* createStreamBuf( const std::string& streamName ) {
|
||||
if( streamName == "stdout" ) return std::cout.rdbuf();
|
||||
if( streamName == "stderr" ) return std::cerr.rdbuf();
|
||||
if( streamName == "debug" ) return new StreamBufImpl<OutputDebugWriter>;
|
||||
Stream createStream( const std::string& streamName ) {
|
||||
if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false );
|
||||
if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false );
|
||||
if( streamName == "debug" ) return Stream( new StreamBufImpl<OutputDebugWriter>, true );
|
||||
|
||||
throw std::domain_error( "Unknown stream: " + streamName );
|
||||
}
|
||||
|
Reference in New Issue
Block a user