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

Unified Diff: test/cctest/test-types.cc

Issue 240603004: Fix handlification bug in test (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix use of rand Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index 59a8f0851a47e44e0539513d7e87da433ec84af2..97e4cef340778bf52184e16979faba262ef9c694 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -273,21 +273,26 @@ class Types {
return Type::Constant(values[i], region_);
}
case 3: // array
- return Type::Array(Fuzz(depth / 2), region_);
+ TypeHandle element = Fuzz(depth / 2);
+ return Type::Array(element, region_);
case 4:
case 5:
case 6: { // function
- TypeHandle type = Type::Function(
- Fuzz(depth / 2), Fuzz(depth / 2), rand() % 3, region_);
+ TypeHandle result = Fuzz(depth / 2);
+ TypeHandle receiver = Fuzz(depth / 2);
+ int arity = rng_.NextInt(3);
+ TypeHandle type = Type::Function(result, receiver, arity, region_);
for (int i = 0; i < type->AsFunction()->Arity(); ++i) {
- type->AsFunction()->InitParameter(i, Fuzz(depth - 1));
+ TypeHandle parameter = Fuzz(depth - 1);
+ type->AsFunction()->InitParameter(i, parameter);
}
}
default: { // union
int n = rng_.NextInt(10);
TypeHandle type = None;
for (int i = 0; i < n; ++i) {
- type = Type::Union(type, Fuzz(depth - 1), region_);
+ TypeHandle operand = Fuzz(depth - 1);
+ type = Type::Union(type, operand, region_);
}
return type;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698