diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 10:51:54 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 10:51:54 +0000 |
commit | de5a982b51854b697d87a7d2b342557608266d50 (patch) | |
tree | 86ca895cd1d0596775a55429abb76c9a15435883 /base/test/test_suite.cc | |
parent | 73d916800284bb6950492ea7c2520dd101bea91c (diff) | |
download | chromium_src-de5a982b51854b697d87a7d2b342557608266d50.zip chromium_src-de5a982b51854b697d87a7d2b342557608266d50.tar.gz chromium_src-de5a982b51854b697d87a7d2b342557608266d50.tar.bz2 |
Suppress the "Assertion Failed" dialog of VC++.
This change suppresses assertion-failure dialogs of VC++ and outputs assertion messages to stderr on Windows.
BUG=132037
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10565028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/test_suite.cc')
-rw-r--r-- | base/test/test_suite.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 83a2549..87ee904 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -232,6 +232,12 @@ void TestSuite::SuppressErrorDialogs() { // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx UINT existing_flags = SetErrorMode(new_flags); SetErrorMode(existing_flags | new_flags); + + // Suppress the "Debug Assertion Failed" dialog. + // TODO(hbono): remove this code when gtest has it. + // http://groups.google.com/d/topic/googletestframework/OjuwNlXy5ac/discussion + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); #endif // defined(OS_WIN) } |