diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-06-20 21:43:18 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-06-20 21:43:18 +0000 |
commit | 386da2037dc7b1d063ac43bf146889b1edcafe7e (patch) | |
tree | 3751feb2e92b653ef02a00d1fa2c6b5d907d0723 /test | |
parent | f3cf0a2316b68cbdc64a00eb61fc8ff955259282 (diff) | |
download | googletest-386da2037dc7b1d063ac43bf146889b1edcafe7e.tar.gz googletest-386da2037dc7b1d063ac43bf146889b1edcafe7e.tar.bz2 googletest-386da2037dc7b1d063ac43bf146889b1edcafe7e.zip |
QNX compatibility patch (by Haruka Iwao).
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-port_test.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc index 1c6e2b09..c83e005f 100644 --- a/test/gtest-port_test.cc +++ b/test/gtest-port_test.cc @@ -267,7 +267,7 @@ TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) { EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1)); } -#if GTEST_OS_MAC +#if GTEST_OS_MAC || GTEST_OS_QNX void* ThreadFunc(void* data) { pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data); pthread_mutex_lock(mutex); @@ -297,6 +297,8 @@ TEST(GetThreadCountTest, ReturnsCorrectValue) { void* dummy; ASSERT_EQ(0, pthread_join(thread_id, &dummy)); +# if GTEST_OS_MAC + // MacOS X may not immediately report the updated thread count after // joining a thread, causing flakiness in this test. To counter that, we // wait for up to .5 seconds for the OS to report the correct value. @@ -306,6 +308,9 @@ TEST(GetThreadCountTest, ReturnsCorrectValue) { SleepMilliseconds(100); } + +# endif // GTEST_OS_MAC + EXPECT_EQ(1U, GetThreadCount()); pthread_mutex_destroy(&mutex); } @@ -313,7 +318,7 @@ TEST(GetThreadCountTest, ReturnsCorrectValue) { TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) { EXPECT_EQ(0U, GetThreadCount()); } -#endif // GTEST_OS_MAC +#endif // GTEST_OS_MAC || GTEST_OS_QNX TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) { const bool a_false_condition = false; |