From 25dccdb2ebbe7eda5b9d029b706bfe12ea231393 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 Refs: https://github.com/nodejs/node/commit/d7f11077f15f52a2db191d3a5bcc41581cb7361f Fixes: https://github.com/nodejs/node/issues/30257 --- 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();