Skip to content

Commit fdb4dbc

Browse files
danbevMylesBorins
authored andcommitted
test: remove destructor from node_test_fixture
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 <jasnell@gmail.com>
1 parent 659b2a1 commit fdb4dbc

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

test/cctest/node_test_fixture.h

-5
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ class NodeTestFixture : public ::testing::Test {
6161
protected:
6262
v8::Isolate* isolate_;
6363

64-
~NodeTestFixture() {
65-
TearDown();
66-
}
67-
6864
virtual void SetUp() {
6965
CHECK_EQ(0, uv_loop_init(&current_loop));
7066
platform_ = new node::NodePlatform(8, &current_loop, nullptr);
@@ -76,7 +72,6 @@ class NodeTestFixture : public ::testing::Test {
7672
}
7773

7874
virtual void TearDown() {
79-
if (platform_ == nullptr) return;
8075
platform_->Shutdown();
8176
while (uv_loop_alive(&current_loop)) {
8277
uv_run(&current_loop, UV_RUN_ONCE);

test/cctest/test_aliased_buffer.cc

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@
55

66
using node::AliasedBuffer;
77

8-
class AliasBufferTest : public NodeTestFixture {
9-
protected:
10-
void SetUp() override {
11-
NodeTestFixture::SetUp();
12-
}
13-
14-
void TearDown() override {
15-
NodeTestFixture::TearDown();
16-
}
17-
};
8+
class AliasBufferTest : public NodeTestFixture {};
189

1910
template<class NativeT>
2011
void CreateOracleValues(NativeT* buf, size_t count) {

0 commit comments

Comments
 (0)