From 4226b64c7dffa79cc7cde0d0860b59c45fc7dd6b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 16 Dec 2012 15:20:01 -0800 Subject: [PATCH] Disable message boxes on assertion failures. --- format_test.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/format_test.cc b/format_test.cc index 34757456..5eeb9e81 100644 --- a/format_test.cc +++ b/format_test.cc @@ -751,3 +751,15 @@ TEST(ActiveFormatterTest, Example) { std::string path = "somefile"; ReportError("File not found: {0}") << path; } + +int main(int argc, char **argv) { +#ifdef _WIN32 + // Disable message boxes on assertion failures. + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); +#endif + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +}