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

Unified Diff: test/base-unittests/platform/platform-unittest.cc

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
Index: test/base-unittests/platform/platform-unittest.cc
diff --git a/test/base-unittests/platform/platform-unittest.cc b/test/base-unittests/platform/platform-unittest.cc
index 3530ff8073a386c72ed8ebcb2de350c33227569e..38b1eb92b678c68f29daa32c82aead537b214c31 100644
--- a/test/base-unittests/platform/platform-unittest.cc
+++ b/test/base-unittests/platform/platform-unittest.cc
@@ -56,40 +56,40 @@ namespace {
class ThreadLocalStorageTest : public Thread, public ::testing::Test {
public:
ThreadLocalStorageTest() : Thread(Options("ThreadLocalStorageTest")) {
- for (size_t i = 0; i < ARRAY_SIZE(keys_); ++i) {
+ for (size_t i = 0; i < arraysize(keys_); ++i) {
keys_[i] = Thread::CreateThreadLocalKey();
}
}
~ThreadLocalStorageTest() {
- for (size_t i = 0; i < ARRAY_SIZE(keys_); ++i) {
+ for (size_t i = 0; i < arraysize(keys_); ++i) {
Thread::DeleteThreadLocalKey(keys_[i]);
}
}
virtual void Run() V8_FINAL V8_OVERRIDE {
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
+ for (size_t i = 0; i < arraysize(keys_); i++) {
CHECK(!Thread::HasThreadLocal(keys_[i]));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
+ for (size_t i = 0; i < arraysize(keys_); i++) {
Thread::SetThreadLocal(keys_[i], GetValue(i));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
+ for (size_t i = 0; i < arraysize(keys_); i++) {
CHECK(Thread::HasThreadLocal(keys_[i]));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
+ for (size_t i = 0; i < arraysize(keys_); i++) {
CHECK_EQ(GetValue(i), Thread::GetThreadLocal(keys_[i]));
CHECK_EQ(GetValue(i), Thread::GetExistingThreadLocal(keys_[i]));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
- Thread::SetThreadLocal(keys_[i], GetValue(ARRAY_SIZE(keys_) - i - 1));
+ for (size_t i = 0; i < arraysize(keys_); i++) {
+ Thread::SetThreadLocal(keys_[i], GetValue(arraysize(keys_) - i - 1));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
+ for (size_t i = 0; i < arraysize(keys_); i++) {
CHECK(Thread::HasThreadLocal(keys_[i]));
}
- for (size_t i = 0; i < ARRAY_SIZE(keys_); i++) {
- CHECK_EQ(GetValue(ARRAY_SIZE(keys_) - i - 1),
+ for (size_t i = 0; i < arraysize(keys_); i++) {
+ CHECK_EQ(GetValue(arraysize(keys_) - i - 1),
Thread::GetThreadLocal(keys_[i]));
- CHECK_EQ(GetValue(ARRAY_SIZE(keys_) - i - 1),
+ CHECK_EQ(GetValue(arraysize(keys_) - i - 1),
Thread::GetExistingThreadLocal(keys_[i]));
}
}

Powered by Google App Engine
This is Rietveld 408576698