Skip to content

Commit a13fbdd

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 <[email protected]>
1 parent aabbdc8 commit a13fbdd

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
@@ -63,10 +63,6 @@ class NodeTestFixture : public ::testing::Test {
6363
protected:
6464
v8::Isolate* isolate_;
6565

66-
~NodeTestFixture() {
67-
TearDown();
68-
}
69-
7066
virtual void SetUp() {
7167
CHECK_EQ(0, uv_loop_init(&current_loop));
7268
platform_ = new node::NodePlatform(8, nullptr);
@@ -78,7 +74,6 @@ class NodeTestFixture : public ::testing::Test {
7874
}
7975

8076
virtual void TearDown() {
81-
if (platform_ == nullptr) return;
8277
platform_->Shutdown();
8378
while (uv_loop_alive(&current_loop)) {
8479
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)