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

Side by Side Diff: src/compiler/machine-operator-unittest.cc

Issue 540823002: Refactor common unit test code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/machine-operator-reducer-unittest.cc ('k') | src/test/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/compiler-unittests.h"
6 #include "src/compiler/machine-operator.h" 5 #include "src/compiler/machine-operator.h"
7 #include "src/compiler/operator-properties-inl.h" 6 #include "src/compiler/operator-properties-inl.h"
8 #include "testing/gmock/include/gmock/gmock.h" 7 #include "src/test/test-utils.h"
9
10 using testing::IsNull;
11 8
12 namespace v8 { 9 namespace v8 {
13 namespace internal { 10 namespace internal {
14 namespace compiler { 11 namespace compiler {
15 12
16 class MachineOperatorCommonTest : public CompilerTestWithParam<MachineType> { 13 class MachineOperatorCommonTest
14 : public TestWithZone,
15 public ::testing::WithParamInterface<MachineType> {
17 public: 16 public:
18 MachineOperatorCommonTest() : machine_(NULL) {} 17 MachineOperatorCommonTest() : machine_(NULL) {}
19 virtual ~MachineOperatorCommonTest() { EXPECT_THAT(machine_, IsNull()); } 18 virtual ~MachineOperatorCommonTest() { EXPECT_EQ(NULL, machine_); }
20 19
21 virtual void SetUp() OVERRIDE { 20 virtual void SetUp() OVERRIDE {
22 CompilerTestWithParam<MachineType>::SetUp(); 21 TestWithZone::SetUp();
22 EXPECT_EQ(NULL, machine_);
23 machine_ = new MachineOperatorBuilder(zone(), GetParam()); 23 machine_ = new MachineOperatorBuilder(zone(), GetParam());
24 } 24 }
25 25
26 virtual void TearDown() OVERRIDE { 26 virtual void TearDown() OVERRIDE {
27 ASSERT_TRUE(machine_ != NULL);
27 delete machine_; 28 delete machine_;
28 machine_ = NULL; 29 machine_ = NULL;
29 CompilerTestWithParam<MachineType>::TearDown(); 30 TestWithZone::TearDown();
30 } 31 }
31 32
32 protected: 33 protected:
33 MachineOperatorBuilder* machine() const { return machine_; } 34 MachineOperatorBuilder* machine() const { return machine_; }
34 35
35 private: 36 private:
36 MachineOperatorBuilder* machine_; 37 MachineOperatorBuilder* machine_;
37 }; 38 };
38 39
39 40
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); 77 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
77 } 78 }
78 79
79 80
80 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest, 81 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest,
81 ::testing::Values(kRepWord32, kRepWord64)); 82 ::testing::Values(kRepWord32, kRepWord64));
82 83
83 } // namespace compiler 84 } // namespace compiler
84 } // namespace internal 85 } // namespace internal
85 } // namespace v8 86 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/machine-operator-reducer-unittest.cc ('k') | src/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698