0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: use InitializeNodeWithArgs in cctest

Refs: d7f11077f1
Fixes: https://github.com/nodejs/node/issues/30257

PR-URL: https://github.com/nodejs/node/pull/32406
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen 2020-03-21 11:25:14 +01:00 committed by Matheus Marchini
parent 6b5f82d7f8
commit f2cc28aec3
No known key found for this signature in database
GPG Key ID: BE516BA4874DB4D9

View File

@ -72,11 +72,13 @@ class NodeZeroIsolateTestFixture : public ::testing::Test {
if (!node_initialized) {
uv_os_unsetenv("NODE_OPTIONS");
node_initialized = true;
int argc = 1;
const char* argv0 = "cctest";
int exec_argc;
const char** exec_argv;
node::Init(&argc, &argv0, &exec_argc, &exec_argv);
std::vector<std::string> argv { "cctest" };
std::vector<std::string> exec_argv;
std::vector<std::string> errors;
int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors);
CHECK_EQ(exitcode, 0);
CHECK(errors.empty());
}
tracing_agent = std::make_unique<node::tracing::Agent>();