From f2cc28aec3e7e938d070f04466055509961d7acb Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 21 Mar 2020 11:25:14 +0100 Subject: [PATCH] test: use InitializeNodeWithArgs in cctest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/commit/d7f11077f15f52a2db191d3a5bcc41581cb7361f Fixes: https://github.com/nodejs/node/issues/30257 PR-URL: https://github.com/nodejs/node/pull/32406 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: Matheus Marchini Reviewed-By: David Carlier Reviewed-By: James M Snell --- test/cctest/node_test_fixture.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index 6d545fdc133677..3be1a68f32109e 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -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 argv { "cctest" }; + std::vector exec_argv; + std::vector errors; + + int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors); + CHECK_EQ(exitcode, 0); + CHECK(errors.empty()); } tracing_agent = std::make_unique();