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

Unified Diff: test/cctest/test-typing-reset.cc

Issue 1319983004: Refactor type collector testing macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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/test-typing-reset.cc
diff --git a/test/cctest/test-typing-reset.cc b/test/cctest/test-typing-reset.cc
index 1dc701b55439f33897d8fde65efe70f76f150b82..55a368f25e646efecdc408cabc25509bb6bf8a6a 100644
--- a/test/cctest/test-typing-reset.cc
+++ b/test/cctest/test-typing-reset.cc
@@ -17,6 +17,8 @@
#include "test/cctest/expression-type-collector.h"
#include "test/cctest/expression-type-collector-macros.h"
+#define INT32_TYPE Bounds(Type::Signed32(), Type::Signed32())
+
using namespace v8::internal;
namespace {
@@ -27,14 +29,13 @@ class TypeSetter : public AstExpressionVisitor {
protected:
void VisitExpression(Expression* expression) {
- expression->set_bounds(Bounds(Type::Integral32()));
+ expression->set_bounds(INT32_TYPE);
}
};
void CheckAllSame(ZoneVector<ExpressionTypeEntry>& types,
Bounds expected_type) {
- HandleAndZoneScope handles;
CHECK_TYPES_BEGIN {
// function logSum
CHECK_EXPR(FunctionLiteral, expected_type) {
@@ -256,6 +257,7 @@ TEST(ResetTypingInfo) {
v8::V8::Initialize();
HandleAndZoneScope handles;
+ Zone* zone = handles.main_zone();
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
@@ -266,7 +268,7 @@ TEST(ResetTypingInfo) {
i::Handle<i::Script> script = factory->NewScript(source_code);
- i::ParseInfo info(handles.main_zone(), script);
+ i::ParseInfo info(zone, script);
i::Parser parser(&info);
parser.set_allow_harmony_arrow_functions(true);
parser.set_allow_harmony_sloppy(true);
@@ -281,7 +283,7 @@ TEST(ResetTypingInfo) {
info.scope()->declarations()->at(0)->AsFunctionDeclaration()->fun());
// Core of the test.
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
+ ZoneVector<ExpressionTypeEntry> types(zone);
ExpressionTypeCollector(&compilation_info, &types).Run();
CheckAllSame(types, DEFAULT_TYPE);
« test/cctest/expression-type-collector-macros.h ('K') | « test/cctest/test-ast-expression-visitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698