Skip to content

Commit

Permalink
test: remove destructor from node_test_fixture
Browse files Browse the repository at this point in the history
This commit removes the destructor from node_test_fixture.h which calls
the TearDown function causing TearDown to be called twice. This also
allows us to remove the check of the platform_ in TearDown.

Also the Setup/TearDown functions in AliasBufferTest are removed as they
are not necessary.

PR-URL: #18524
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
danbev authored and MylesBorins committed Mar 20, 2018
1 parent 0bc0bbd commit 9e29fec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
5 changes: 0 additions & 5 deletions test/cctest/node_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ class NodeTestFixture : public ::testing::Test {
protected:
v8::Isolate* isolate_;

~NodeTestFixture() {
TearDown();
}

virtual void SetUp() {
CHECK_EQ(0, uv_loop_init(&current_loop));
platform_ = new node::NodePlatform(8, &current_loop, nullptr);
Expand All @@ -76,7 +72,6 @@ class NodeTestFixture : public ::testing::Test {
}

virtual void TearDown() {
if (platform_ == nullptr) return;
platform_->Shutdown();
while (uv_loop_alive(&current_loop)) {
uv_run(&current_loop, UV_RUN_ONCE);
Expand Down
11 changes: 1 addition & 10 deletions test/cctest/test_aliased_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@

using node::AliasedBuffer;

class AliasBufferTest : public NodeTestFixture {
protected:
void SetUp() override {
NodeTestFixture::SetUp();
}

void TearDown() override {
NodeTestFixture::TearDown();
}
};
class AliasBufferTest : public NodeTestFixture {};

template<class NativeT>
void CreateOracleValues(NativeT* buf, size_t count) {
Expand Down

0 comments on commit 9e29fec

Please sign in to comment.