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

Unified Diff: test/unittests/compiler/node-properties-unittest.cc

Issue 851263002: [turbofan] Initial attempt to cleanup Node and related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « test/unittests/compiler/graph-unittest.cc ('k') | test/unittests/compiler/node-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/node-properties-unittest.cc
diff --git a/test/unittests/compiler/node-properties-unittest.cc b/test/unittests/compiler/node-properties-unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4b11b555ebb46b9c098946b1419c8a35ed9199c9
--- /dev/null
+++ b/test/unittests/compiler/node-properties-unittest.cc
@@ -0,0 +1,32 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/common-operator.h"
+#include "src/compiler/node-properties-inl.h"
+#include "test/unittests/test-utils.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+using testing::IsNull;
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+typedef TestWithZone NodePropertiesTest;
+
+
+TEST_F(NodePropertiesTest, FindProjection) {
+ CommonOperatorBuilder common(zone());
+ Node* start = Node::New(zone(), 0, common.Start(1), 0, nullptr, false);
+ Node* proj0 = Node::New(zone(), 1, common.Projection(0), 1, &start, false);
+ Node* proj1 = Node::New(zone(), 2, common.Projection(1), 1, &start, false);
+ EXPECT_EQ(proj0, NodeProperties::FindProjection(start, 0));
+ EXPECT_EQ(proj1, NodeProperties::FindProjection(start, 1));
+ EXPECT_THAT(NodeProperties::FindProjection(start, 2), IsNull());
+ EXPECT_THAT(NodeProperties::FindProjection(start, 1234567890), IsNull());
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « test/unittests/compiler/graph-unittest.cc ('k') | test/unittests/compiler/node-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698