diff options
author | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 20:33:02 +0000 |
---|---|---|
committer | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 20:33:02 +0000 |
commit | 31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4 (patch) | |
tree | f0903b0947fc84421556ebec81fdc7de78087db5 /base/cancellation_flag_unittest.cc | |
parent | b2ba996f96dfd3bde403fce818258d97e3ca8002 (diff) | |
download | chromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.zip chromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.tar.gz chromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.tar.bz2 |
Force failing CHECK/DCHECKs to end the process on Windows.
The current implementation of Windows-only hook simply calls FAIL.
According to http://code.google.com/p/googletest/issues/list?cursor=234
it is a misuse of FAIL macros (it may not shut down the process).
As a result, it was impossible to write death tests on windows.
BUG=24885
Review URL: http://codereview.chromium.org/482001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/cancellation_flag_unittest.cc')
-rw-r--r-- | base/cancellation_flag_unittest.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/base/cancellation_flag_unittest.cc b/base/cancellation_flag_unittest.cc index ffc8cf0..52f6b1e 100644 --- a/base/cancellation_flag_unittest.cc +++ b/base/cancellation_flag_unittest.cc @@ -49,18 +49,10 @@ TEST(CancellationFlagTest, DoubleSetTest) { ASSERT_TRUE(flag.IsSet()); } -#if defined(OS_WIN) -#define DISABLED_ON_WIN(x) DISABLED_##x -#else -#define DISABLED_ON_WIN(x) x -#endif - -// CancellationFlag should die on a DCHECK if Set() is called from -// other thread. -// This test isn't Windows-friendly yet since ASSERT_DEATH doesn't catch tests -// failed on DCHECK. See http://crbug.com/24885 for the details. -TEST(CancellationFlagTest, DISABLED_ON_WIN(SetOnDifferentThreadDeathTest)) { +TEST(CancellationFlagTest, SetOnDifferentThreadDeathTest) { // Checks that Set() can't be called from any other thread. + // CancellationFlag should die on a DCHECK if Set() is called from + // other thread. ::testing::FLAGS_gtest_death_test_style = "threadsafe"; Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest"); ASSERT_TRUE(t.Start()); |