Allows unit tests that just need a zone and no isolate to avoid the overhead of
creating one.
R=mstarzinger@chromium.org
LOG=N
Review URL: https://codereview.chromium.org/
871843004
Cr-Commit-Position: refs/heads/master@{#26256}
using ::testing::Matcher;
-class GraphTest : public TestWithContext, public TestWithZone {
+class GraphTest : public TestWithContext, public TestWithIsolateAndZone {
public:
explicit GraphTest(int num_parameters = 1);
~GraphTest() OVERRIDE;
namespace internal {
namespace compiler {
-class InstructionSelectorTest : public TestWithContext, public TestWithZone {
+class InstructionSelectorTest : public TestWithContext,
+ public TestWithIsolateAndZone {
public:
InstructionSelectorTest();
~InstructionSelectorTest() OVERRIDE;
namespace internal {
namespace compiler {
-class InstructionSequenceTest : public TestWithZone {
+class InstructionSequenceTest : public TestWithIsolateAndZone {
public:
static const int kDefaultNRegs = 4;
static const int kNoValue = kMinInt;
namespace internal {
namespace compiler {
-typedef TestWithZone BasicBlockTest;
+typedef TestWithIsolateAndZone BasicBlockTest;
TEST_F(BasicBlockTest, Constructor) {
TestWithIsolate::~TestWithIsolate() {}
+TestWithIsolateAndZone::~TestWithIsolateAndZone() {}
Factory* TestWithIsolate::factory() const { return isolate()->factory(); }
};
-class TestWithZone : public TestWithIsolate {
+class TestWithZone : public virtual ::testing::Test {
public:
TestWithZone() {}
virtual ~TestWithZone();
DISALLOW_COPY_AND_ASSIGN(TestWithZone);
};
+
+class TestWithIsolateAndZone : public virtual TestWithIsolate {
+ public:
+ TestWithIsolateAndZone() {}
+ virtual ~TestWithIsolateAndZone();
+
+ Zone* zone() { return &zone_; }
+
+ private:
+ Zone zone_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestWithIsolateAndZone);
+};
+
+
} // namespace internal
} // namespace v8