summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-06-20 21:43:18 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-06-20 21:43:18 +0000
commit105b1431c37c159892cc0983dd0bc2411c6f0c96 (patch)
tree3751feb2e92b653ef02a00d1fa2c6b5d907d0723 /test
parent4f9248a4270559cf286cb12937ba78b58bde053f (diff)
downloadgtest-105b1431c37c159892cc0983dd0bc2411c6f0c96.tar.gz
gtest-105b1431c37c159892cc0983dd0bc2411c6f0c96.tar.bz2
gtest-105b1431c37c159892cc0983dd0bc2411c6f0c96.tar.xz
QNX compatibility patch (by Haruka Iwao).
git-svn-id: http://googletest.googlecode.com/svn/trunk@586 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test')
-rw-r--r--test/gtest-port_test.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc
index 1c6e2b0..c83e005 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;