Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2617)

Unified Diff: base/debug_unittest.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug.cc ('k') | base/disk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug_unittest.cc
diff --git a/base/debug_unittest.cc b/base/debug_unittest.cc
deleted file mode 100644
index ee74ad8d4d2311527f6e0830c863ea2254203596..0000000000000000000000000000000000000000
--- a/base/debug_unittest.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2003-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-//
-// Debug unittest
-
-#include <stdexcept>
-
-#include "omaha/base/debug.h"
-#include "omaha/base/test.h"
-#include "omaha/base/time.h"
-
-namespace omaha {
-
-// test what happens when we hit an exception
-int SEHExceptionTest(int level, int reserved) {
- const uint32 kflags = MB_SETFOREGROUND |
- MB_TOPMOST |
- MB_ICONWARNING |
- MB_OKCANCEL;
- if (::MessageBox(NULL,
- L"do exception?",
- L"exception test",
- kflags) == IDOK) {
- int *a1 = static_cast<int *>(1);
- *a1 = 2;
-
- // if that does not work try:
- // simulate a divide by zero
- int a = 10;
- int b2 = a;
- b2 /= 2;
- b2 -= 5;
- // int c = a/b2;
- int c = 0;
- TCHAR *s = 0;
- s++;
- *s = 0;
-
- RaiseException(EXCEPTION_BREAKPOINT, 0, 0, NULL);
- }
-
- return 0;
-}
-
-int SEHCatchExceptionTest(int level, int reserved) {
- __try {
- SEHExceptionTest(level, reserved);
- } __except (SehSendMinidump(GetExceptionCode(),
- GetExceptionInformation(),
- kMinsTo100ns)) {
- }
-
- return 0;
-}
-
-#pragma warning(push)
-#pragma warning(disable:4702)
-// test what happens when we do a C++ exception
-int CppExceptionTest(int level, int reserved) {
- _TRY_BEGIN
-#if 0
- _THROW(std::logic_error, "throwing a fake logic_error");
-#else
-// std::logic_error e("throwing a fake logic_error");
- // e._Raise();
- std::runtime_error(std::string("throwing a fake logic_error"))._Raise();
-#endif
- _CATCH(std::logic_error e)
- ASSERT(false, (L"caught exception"));
- _CATCH_END
- return 0;
-}
-#pragma warning(pop)
-
-// test what happens when we do a REPORT
-int ReportTest(int level, int reserved) {
- REPORT(false, R_ERROR, (L"test REPORT"), 592854117);
- return 0;
-}
-
-// test what happens when we hit an ASSERT
-int AssertTest(int level, int reserved) {
- ASSERT(false, (L"test ASSERT"));
- return 0;
-}
-
-// test what happens when we hit an ABORT
-int AbortTest(int level, int reserved) {
- ABORT((L"test ABORT"));
- ASSERT(false, (L"returned from ABORT"));
- return 0;
-}
-
-} // namespace omaha
-
« no previous file with comments | « base/debug.cc ('k') | base/disk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698