Suppress output when running unit tests.

This does two things:
1) Now does not output to debug.log if -printtodebugger flag is passed
2) Unit tests set -printtodebugger so only test results are output to stdout

Note that -printtodebugger only actually prints to the debugger on Windows.
This commit is contained in:
Gavin Andresen 2012-08-20 11:33:20 -04:00
parent b3a570d158
commit 4d51be1cf3
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ extern void noui_connect();
struct TestingSetup { struct TestingSetup {
TestingSetup() { TestingSetup() {
fPrintToConsole = true; // don't want to write to debug.log file fPrintToDebugger = true; // don't want to write to debug.log file
noui_connect(); noui_connect();
bitdb.MakeMock(); bitdb.MakeMock();
LoadBlockIndex(true); LoadBlockIndex(true);

View File

@ -204,7 +204,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
ret = vprintf(pszFormat, arg_ptr); ret = vprintf(pszFormat, arg_ptr);
va_end(arg_ptr); va_end(arg_ptr);
} }
else else if (!fPrintToDebugger)
{ {
// print to debug.log // print to debug.log
static FILE* fileout = NULL; static FILE* fileout = NULL;