summaryrefslogtreecommitdiff
path: root/test/cctest
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2017-04-13 12:34:19 +0200
committerJames M Snell <jasnell@gmail.com>2017-04-18 10:49:20 -0700
commit6c912a8216e70bca089f581c32dd58764adefe74 (patch)
treef11ade5a4e45329cfee3a7c83d51b10cf06107c8 /test/cctest
parent4fc11998b4c3f90ba276cc573833e7a7322bbd15 (diff)
downloadandroid-node-v8-6c912a8216e70bca089f581c32dd58764adefe74.tar.gz
android-node-v8-6c912a8216e70bca089f581c32dd58764adefe74.tar.bz2
android-node-v8-6c912a8216e70bca089f581c32dd58764adefe74.zip
test: fix coverity UNINIT_CTOR cctest warning
Explicitly initialize `platform_` to nullptr. Coverity cannot divine it is set and cleared by the Setup() and TearDown() methods. PR-URL: https://github.com/nodejs/node/pull/12387 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/cctest')
-rw-r--r--test/cctest/node_test_fixture.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h
index bf155c5894..f5a25c70b5 100644
--- a/test/cctest/node_test_fixture.h
+++ b/test/cctest/node_test_fixture.h
@@ -79,6 +79,10 @@ class NodeTestFixture : public ::testing::Test {
ArrayBufferAllocator allocator_;
v8::Isolate* isolate_;
+ ~NodeTestFixture() {
+ TearDown();
+ }
+
virtual void SetUp() {
platform_ = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform_);
@@ -88,13 +92,14 @@ class NodeTestFixture : public ::testing::Test {
}
virtual void TearDown() {
+ if (platform_ == nullptr) return;
v8::V8::ShutdownPlatform();
delete platform_;
platform_ = nullptr;
}
private:
- v8::Platform* platform_;
+ v8::Platform* platform_ = nullptr;
};
#endif // TEST_CCTEST_NODE_TEST_FIXTURE_H_