OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 // | 10 // |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); | 71 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); |
72 | 72 |
73 #if defined(WEBRTC_WIN) | 73 #if defined(WEBRTC_WIN) |
74 if (!FLAG_default_error_handlers) { | 74 if (!FLAG_default_error_handlers) { |
75 // Make sure any errors don't throw dialogs hanging the test run. | 75 // Make sure any errors don't throw dialogs hanging the test run. |
76 _set_invalid_parameter_handler(TestInvalidParameterHandler); | 76 _set_invalid_parameter_handler(TestInvalidParameterHandler); |
77 _set_purecall_handler(TestPureCallHandler); | 77 _set_purecall_handler(TestPureCallHandler); |
78 _CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, TestCrtReportHandler); | 78 _CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, TestCrtReportHandler); |
79 } | 79 } |
80 | 80 |
81 #ifdef _DEBUG // Turn on memory leak checking on Windows. | 81 #if !defined(NDEBUG) // Turn on memory leak checking on Windows. |
82 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF |_CRTDBG_LEAK_CHECK_DF); | 82 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF |_CRTDBG_LEAK_CHECK_DF); |
83 if (FLAG_crt_break_alloc >= 0) { | 83 if (FLAG_crt_break_alloc >= 0) { |
84 _crtBreakAlloc = FLAG_crt_break_alloc; | 84 _crtBreakAlloc = FLAG_crt_break_alloc; |
85 } | 85 } |
86 #endif // _DEBUG | 86 #endif |
87 #endif // WEBRTC_WIN | 87 #endif // WEBRTC_WIN |
88 | 88 |
89 rtc::Filesystem::SetOrganizationName("google"); | 89 rtc::Filesystem::SetOrganizationName("google"); |
90 rtc::Filesystem::SetApplicationName("unittest"); | 90 rtc::Filesystem::SetApplicationName("unittest"); |
91 | 91 |
92 // By default, log timestamps. Allow overrides by used of a --log flag. | 92 // By default, log timestamps. Allow overrides by used of a --log flag. |
93 rtc::LogMessage::LogTimestamps(); | 93 rtc::LogMessage::LogTimestamps(); |
94 if (*FLAG_log != '\0') { | 94 if (*FLAG_log != '\0') { |
95 rtc::LogMessage::ConfigureLogging(FLAG_log); | 95 rtc::LogMessage::ConfigureLogging(FLAG_log); |
96 } | 96 } |
(...skipping 10 matching lines...) Expand all Loading... |
107 | 107 |
108 #if defined(WEBRTC_WIN) | 108 #if defined(WEBRTC_WIN) |
109 // Unhook crt function so that we don't ever log after statics have been | 109 // Unhook crt function so that we don't ever log after statics have been |
110 // uninitialized. | 110 // uninitialized. |
111 if (!FLAG_default_error_handlers) | 111 if (!FLAG_default_error_handlers) |
112 _CrtSetReportHook2(_CRT_RPTHOOK_REMOVE, TestCrtReportHandler); | 112 _CrtSetReportHook2(_CRT_RPTHOOK_REMOVE, TestCrtReportHandler); |
113 #endif | 113 #endif |
114 | 114 |
115 return res; | 115 return res; |
116 } | 116 } |
OLD | NEW |