From 9a5ec9c57ce37cb2884ad8fae820dce744bb4eea Mon Sep 17 00:00:00 2001 From: Benedikt Meurer Date: Tue, 25 Nov 2014 08:21:43 +0100 Subject: [PATCH] Fix platform unittests. Follow-up to 87db4ff1f4d76eecb8f19d62f4c04279d56bf229, which added suppressions to unittests.status and a special case for Android to the ThreadLocalStorageTest, both of which are unneccessary and should be handled differently for the GTest based unittests. BUG=v8:3706 LOG=n R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/757913002 Cr-Commit-Position: refs/heads/master@{#25495} --- .../base/platform/platform-unittest.cc | 18 ++++++++++-------- test/unittests/unittests.status | 7 ------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/test/unittests/base/platform/platform-unittest.cc b/test/unittests/base/platform/platform-unittest.cc index b972d8ab3e..b17a9b9ef4 100644 --- a/test/unittests/base/platform/platform-unittest.cc +++ b/test/unittests/base/platform/platform-unittest.cc @@ -13,6 +13,12 @@ #endif #include "testing/gtest/include/gtest/gtest.h" +#if V8_OS_ANDROID +#define DISABLE_ON_ANDROID(Name) DISABLED_##Name +#else +#define DISABLE_ON_ANDROID(Name) Name +#endif + namespace v8 { namespace base { @@ -33,13 +39,13 @@ namespace { class SelfJoinThread FINAL : public Thread { public: SelfJoinThread() : Thread(Options("SelfJoinThread")) {} - virtual void Run() OVERRIDE { Join(); } + void Run() FINAL { Join(); } }; } // namespace -TEST(Thread, SelfJoin) { +TEST(Thread, DISABLE_ON_ANDROID(SelfJoin)) { SelfJoinThread thread; thread.Start(); thread.Join(); @@ -61,7 +67,7 @@ class ThreadLocalStorageTest : public Thread, public ::testing::Test { } } - virtual void Run() FINAL OVERRIDE { + void Run() FINAL { for (size_t i = 0; i < arraysize(keys_); i++) { CHECK(!Thread::HasThreadLocal(keys_[i])); } @@ -91,16 +97,12 @@ class ThreadLocalStorageTest : public Thread, public ::testing::Test { private: static void* GetValue(size_t x) { - return reinterpret_cast(static_cast(x + 1)); + return bit_cast(static_cast(x + 1)); } -#if defined(ANDROID) // Older versions of Android have fewer TLS slots (nominally 64, but the // system uses "about 5 of them" itself). Thread::LocalStorageKey keys_[32]; -#else - Thread::LocalStorageKey keys_[256]; -#endif }; } // namespace diff --git a/test/unittests/unittests.status b/test/unittests/unittests.status index 021d38b140..d439913ccf 100644 --- a/test/unittests/unittests.status +++ b/test/unittests/unittests.status @@ -3,11 +3,4 @@ # found in the LICENSE file. [ - -############################################################################## -['arch == android_arm or arch == android_ia32', { - - # This test times out. - 'Thread.SelfJoin': [SKIP], -}], # 'arch == android_arm or arch == android_ia32' ]