Skip to content
Snippets Groups Projects
Commit 29015ca1 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Unnecessary error stream redirection removed

parent 5bbf5503
No related branches found
No related tags found
No related merge requests found
#ifndef ERRORSTREAMREDIRECT_H
#define ERRORSTREAMREDIRECT_H
#include <iostream>
struct ErrorStreamRedirect {
ErrorStreamRedirect( std::streambuf* new_buffer )
: old( std::cerr.rdbuf(new_buffer) )
{}
~ErrorStreamRedirect() {
std::cerr.rdbuf(old);
}
private:
std::streambuf* old;
};
#endif // ERRORSTREAMREDIRECT_H
#include "google_test.h"
#include "testlist.h"
#include "ErrorStreamRedirect.h"
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
// redirect std::cerr stream
std::stringstream oss;
ErrorStreamRedirect redirecter( oss.rdbuf() );
(void)redirecter;
// run all google tests
return RUN_ALL_TESTS();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment