Skip to content

Commit 83c9315

Browse files
committed
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 <[email protected]>
1 parent b9a873e commit 83c9315

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

test/cctest/node_test_fixture.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ class NodeTestFixture : public ::testing::Test {
6464
protected:
6565
v8::Isolate* isolate_;
6666

67-
~NodeTestFixture() {
68-
TearDown();
69-
}
70-
7167
virtual void SetUp() {
7268
CHECK_EQ(0, uv_loop_init(&current_loop));
7369
platform_ = new node::NodePlatform(8, nullptr);
@@ -86,7 +82,6 @@ class NodeTestFixture : public ::testing::Test {
8682
}
8783

8884
virtual void TearDown() {
89-
if (platform_ == nullptr) return;
9085
platform_->Shutdown();
9186
while (uv_loop_alive(&current_loop)) {
9287
uv_run(&current_loop, UV_RUN_ONCE);

test/cctest/test_aliased_buffer.cc

Lines changed: 1 addition & 10 deletions
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)