deps: update googletest to e4fdb87 · nodejs/node@301541c · GitHub
Skip to content

Commit 301541c

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to e4fdb87
PR-URL: #51657 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 981d57e commit 301541c

4 files changed

Lines changed: 69 additions & 40 deletions

File tree

deps/googletest/include/gtest/gtest.h

Lines changed: 16 additions & 0 deletions

deps/googletest/src/gtest-death-test.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,13 @@ bool DeathTestImpl::Passed(bool status_ok) {
630630
#ifndef GTEST_OS_WINDOWS
631631
// Note: The return value points into args, so the return value's lifetime is
632632
// bound to that of args.
633-
static std::unique_ptr<char*[]> CreateArgvFromArgs(
634-
std::vector<std::string>& args) {
635-
auto result = std::make_unique<char*[]>(args.size() + 1);
636-
for (size_t i = 0; i < args.size(); ++i) {
637-
result[i] = &args[i][0];
633+
static std::vector<char*> CreateArgvFromArgs(std::vector<std::string>& args) {
634+
std::vector<char*> result;
635+
result.reserve(args.size() + 1);
636+
for (auto& arg : args) {
637+
result.push_back(&arg[0]);
638638
}
639-
result[args.size()] = nullptr; // extra null terminator
639+
result.push_back(nullptr); // Extra null terminator.
640640
return result;
641641
}
642642
#endif
@@ -1036,8 +1036,8 @@ DeathTest::TestRole FuchsiaDeathTest::AssumeRole() {
10361036
// "Fuchsia Test Component" which contains a "Fuchsia Component Manifest")
10371037
// Launching processes is a privileged operation in Fuchsia, and the
10381038
// declaration indicates that the ability is required for the component.
1039-
std::unique_ptr<char*[]> argv = CreateArgvFromArgs(args);
1040-
status = fdio_spawn_etc(child_job, FDIO_SPAWN_CLONE_ALL, argv[0], argv.get(),
1039+
std::vector<char*> argv = CreateArgvFromArgs(args);
1040+
status = fdio_spawn_etc(child_job, FDIO_SPAWN_CLONE_ALL, argv[0], argv.data(),
10411041
nullptr, 2, spawn_actions,
10421042
child_process_.reset_and_get_address(), nullptr);
10431043
GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
@@ -1388,8 +1388,8 @@ DeathTest::TestRole ExecDeathTest::AssumeRole() {
13881388
// is necessary.
13891389
FlushInfoLog();
13901390

1391-
std::unique_ptr<char*[]> argv = CreateArgvFromArgs(args);
1392-
const pid_t child_pid = ExecDeathTestSpawnChild(argv.get(), pipe_fd[0]);
1391+
std::vector<char*> argv = CreateArgvFromArgs(args);
1392+
const pid_t child_pid = ExecDeathTestSpawnChild(argv.data(), pipe_fd[0]);
13931393
GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
13941394
set_child_pid(child_pid);
13951395
set_read_fd(pipe_fd[0]);

deps/googletest/src/gtest-internal-inl.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -709,18 +709,6 @@ class GTEST_API_ UnitTestImpl {
709709
return type_parameterized_test_registry_;
710710
}
711711

712-
// Sets the TestSuite object for the test that's currently running.
713-
void set_current_test_suite(TestSuite* a_current_test_suite) {
714-
current_test_suite_ = a_current_test_suite;
715-
}
716-
717-
// Sets the TestInfo object for the test that's currently running. If
718-
// current_test_info is NULL, the assertion results will be stored in
719-
// ad_hoc_test_result_.
720-
void set_current_test_info(TestInfo* a_current_test_info) {
721-
current_test_info_ = a_current_test_info;
722-
}
723-
724712
// Registers all parameterized tests defined using TEST_P and
725713
// INSTANTIATE_TEST_SUITE_P, creating regular tests for each test/parameter
726714
// combination. This method can be called more then once; it has guards
@@ -841,6 +829,18 @@ class GTEST_API_ UnitTestImpl {
841829
// GTEST_FLAG(catch_exceptions) at the moment it starts.
842830
void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
843831

832+
// Sets the TestSuite object for the test that's currently running.
833+
void set_current_test_suite(TestSuite* a_current_test_suite) {
834+
current_test_suite_ = a_current_test_suite;
835+
}
836+
837+
// Sets the TestInfo object for the test that's currently running. If
838+
// current_test_info is NULL, the assertion results will be stored in
839+
// ad_hoc_test_result_.
840+
void set_current_test_info(TestInfo* a_current_test_info) {
841+
current_test_info_ = a_current_test_info;
842+
}
843+
844844
// The UnitTest object that owns this implementation object.
845845
UnitTest* const parent_;
846846

deps/googletest/src/gtest.cc

Lines changed: 31 additions & 18 deletions

0 commit comments

Comments
 (0)