Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2021-05-31 17:17:23 +0300
committerMichaël Zasso <targos@protonmail.com>2021-06-11 08:24:58 +0300
commit1f10e84939679391a30f69b00ea9102c3de05348 (patch)
treed5bfa855bf1a63d78f04265209677f89b6156182 /test
parent70af1467451ab72fd267c53a60160ec9eb6cf95c (diff)
test: suppress warning in test_environment.cc
Currently there is a compiler warning generated if a build defines NDEBUG: $ env CXXFLAGS='-DNDEBUG' make -j8 cctest ../test/cctest/test_environment.cc: In function ‘void at_exit_js(void*)’: ../test/cctest/test_environment.cc:333:25: warning: variable ‘obj’ set but not used [-Wunused-but-set-variable] 333 | v8::Local<v8::Object> obj = v8::Object::New(isolate); | ^~~ NDEBUG is currently not defined using the main branch but this discovered when working on replacing OpenSSL 1.1.1 with OpenSSL 3.0. This commit uses EXPECT statements instead of asserts to avoid the warning. PR-URL: https://github.com/nodejs/node/pull/38868 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/cctest/test_environment.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc
index e2931337bf6..cdd4d470fd6 100644
--- a/test/cctest/test_environment.cc
+++ b/test/cctest/test_environment.cc
@@ -331,8 +331,8 @@ static void at_exit_js(void* arg) {
v8::Isolate* isolate = static_cast<v8::Isolate*>(arg);
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Object> obj = v8::Object::New(isolate);
- assert(!obj.IsEmpty()); // Assert VM is still alive.
- assert(obj->IsObject());
+ EXPECT_FALSE(obj.IsEmpty()); // Assert VM is still alive.
+ EXPECT_TRUE(obj->IsObject());
called_at_exit_js = true;
}