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

Unified Diff: util/misc/initialization_state_dcheck_test.cc

Issue 992693003: Add ASSERT_DEATH_CHECK() to do ASSERT_DEATH() of CHECK() failures (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 9 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 | « util/mach/composite_mach_message_server_test.cc ('k') | util/misc/scoped_forbid_return_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/initialization_state_dcheck_test.cc
diff --git a/util/misc/initialization_state_dcheck_test.cc b/util/misc/initialization_state_dcheck_test.cc
index c9b595ac0a07606809a221e22dc1eadf162c3e39..c1c8e7e212d58b9488c5b97f998d6aa7ff512dc1 100644
--- a/util/misc/initialization_state_dcheck_test.cc
+++ b/util/misc/initialization_state_dcheck_test.cc
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "gtest/gtest.h"
+#include "util/test/gtest_death_check.h"
namespace crashpad {
namespace test {
@@ -37,16 +38,18 @@ TEST(InitializationStateDcheckDeathTest, Uninitialized_NotInvalid) {
// This tests that an attempt to set an uninitialized object as valid without
// transitioning through the initializing (invalid) state fails.
InitializationStateDcheck initialization_state_dcheck;
- ASSERT_DEATH(INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck),
- "kStateInvalid");
+ ASSERT_DEATH_CHECK(
+ INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck),
+ "kStateInvalid");
}
TEST(InitializationStateDcheckDeathTest, Uninitialized_NotValid) {
// This tests that an attempt to use an uninitialized object as though it
// were valid fails.
InitializationStateDcheck initialization_state_dcheck;
- ASSERT_DEATH(INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck),
- "kStateValid");
+ ASSERT_DEATH_CHECK(
+ INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck),
+ "kStateValid");
}
TEST(InitializationStateDcheckDeathTest, Invalid_NotUninitialized) {
@@ -54,7 +57,7 @@ TEST(InitializationStateDcheckDeathTest, Invalid_NotUninitialized) {
// initialization was already attempted fails.
InitializationStateDcheck initialization_state_dcheck;
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
- ASSERT_DEATH(
+ ASSERT_DEATH_CHECK(
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck),
"kStateUninitialized");
}
@@ -64,8 +67,9 @@ TEST(InitializationStateDcheckDeathTest, Invalid_NotValid) {
// were valid fails.
InitializationStateDcheck initialization_state_dcheck;
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
- ASSERT_DEATH(INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck),
- "kStateValid");
+ ASSERT_DEATH_CHECK(
+ INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck),
+ "kStateValid");
}
TEST(InitializationStateDcheckDeathTest, Valid_NotUninitialized) {
@@ -74,7 +78,7 @@ TEST(InitializationStateDcheckDeathTest, Valid_NotUninitialized) {
InitializationStateDcheck initialization_state_dcheck;
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck);
- ASSERT_DEATH(
+ ASSERT_DEATH_CHECK(
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck),
"kStateUninitialized");
}
@@ -85,8 +89,9 @@ TEST(InitializationStateDcheckDeathTest, Valid_NotInvalid) {
InitializationStateDcheck initialization_state_dcheck;
INITIALIZATION_STATE_SET_INITIALIZING(initialization_state_dcheck);
INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck);
- ASSERT_DEATH(INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck),
- "kStateInvalid");
+ ASSERT_DEATH_CHECK(
+ INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck),
+ "kStateInvalid");
}
TEST(InitializationStateDcheckDeathTest, Destroyed_NotUninitialized) {
@@ -101,9 +106,9 @@ TEST(InitializationStateDcheckDeathTest, Destroyed_NotUninitialized) {
INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck);
INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck);
}
- ASSERT_DEATH(INITIALIZATION_STATE_SET_INITIALIZING(
- *initialization_state_dcheck_pointer),
- "kStateUninitialized");
+ ASSERT_DEATH_CHECK(INITIALIZATION_STATE_SET_INITIALIZING(
+ *initialization_state_dcheck_pointer),
+ "kStateUninitialized");
}
TEST(InitializationStateDcheckDeathTest, Destroyed_NotValid) {
@@ -118,7 +123,7 @@ TEST(InitializationStateDcheckDeathTest, Destroyed_NotValid) {
INITIALIZATION_STATE_SET_VALID(initialization_state_dcheck);
INITIALIZATION_STATE_DCHECK_VALID(initialization_state_dcheck);
}
- ASSERT_DEATH(
+ ASSERT_DEATH_CHECK(
INITIALIZATION_STATE_DCHECK_VALID(*initialization_state_dcheck_pointer),
"kStateValid");
}
« no previous file with comments | « util/mach/composite_mach_message_server_test.cc ('k') | util/misc/scoped_forbid_return_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698