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

Unified Diff: test/cctest/compiler/test-node-cache.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/cctest/compiler/test-node-cache.cc
diff --git a/test/cctest/compiler/test-node-cache.cc b/test/cctest/compiler/test-node-cache.cc
index 23909a5f5aed3e02429a3ecd7dbd27643a64dbd0..3569386c85c75ba55669f0f3c4739e5dc8971b28 100644
--- a/test/cctest/compiler/test-node-cache.cc
+++ b/test/cctest/compiler/test-node-cache.cc
@@ -33,15 +33,15 @@ TEST(Int32Constant_five) {
int32_t constants[] = {static_cast<int32_t>(0x80000000), -77, 0, 1, -1};
- Node* nodes[ARRAY_SIZE(constants)];
+ Node* nodes[arraysize(constants)];
- for (size_t i = 0; i < ARRAY_SIZE(constants); i++) {
+ for (size_t i = 0; i < arraysize(constants); i++) {
int32_t k = constants[i];
Node* node = graph.NewNode(common.Int32Constant(k));
*cache.Find(graph.zone(), k) = nodes[i] = node;
}
- for (size_t i = 0; i < ARRAY_SIZE(constants); i++) {
+ for (size_t i = 0; i < arraysize(constants); i++) {
int32_t k = constants[i];
CHECK_EQ(nodes[i], *cache.Find(graph.zone(), k));
}
@@ -121,7 +121,7 @@ TEST(PtrConstant_back_to_back) {
int32_t buffer[50];
for (int32_t* p = buffer;
- (p - buffer) < static_cast<ptrdiff_t>(ARRAY_SIZE(buffer)); p++) {
+ (p - buffer) < static_cast<ptrdiff_t>(arraysize(buffer)); p++) {
Node** pos = cache.Find(graph.zone(), p);
CHECK_NE(NULL, pos);
for (int j = 0; j < 3; j++) {
@@ -140,7 +140,7 @@ TEST(PtrConstant_hits) {
Node* nodes[kSize];
CommonOperatorBuilder common(graph.zone());
- for (size_t i = 0; i < ARRAY_SIZE(buffer); i++) {
+ for (size_t i = 0; i < arraysize(buffer); i++) {
int k = static_cast<int>(i);
int32_t* p = &buffer[i];
nodes[i] = graph.NewNode(common.Int32Constant(k));
@@ -148,7 +148,7 @@ TEST(PtrConstant_hits) {
}
int hits = 0;
- for (size_t i = 0; i < ARRAY_SIZE(buffer); i++) {
+ for (size_t i = 0; i < arraysize(buffer); i++) {
int32_t* p = &buffer[i];
Node** pos = cache.Find(graph.zone(), p);
if (*pos != NULL) {

Powered by Google App Engine
This is Rietveld 408576698