Skip to content

Commit bdf6d41

Browse files
committed
test: use InitializeNodeWithArgs in cctest
Refs: d7f1107 Fixes: #30257 Backport-PR-URL: #35241 PR-URL: #32406 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7a8f59f commit bdf6d41

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/cctest/node_test_fixture.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ class NodeTestFixture : public ::testing::Test {
7373
if (!node_initialized) {
7474
uv_os_unsetenv("NODE_OPTIONS");
7575
node_initialized = true;
76-
int argc = 1;
77-
const char* argv0 = "cctest";
78-
int exec_argc;
79-
const char** exec_argv;
80-
node::Init(&argc, &argv0, &exec_argc, &exec_argv);
76+
std::vector<std::string> argv { "cctest" };
77+
std::vector<std::string> exec_argv;
78+
std::vector<std::string> errors;
79+
80+
int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors);
81+
CHECK_EQ(exitcode, 0);
82+
CHECK(errors.empty());
8183
}
8284

8385
tracing_agent = std::make_unique<node::tracing::Agent>();

0 commit comments

Comments
 (0)