Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update googletest to 34ad51b #53157

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions deps/googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,14 @@ ::std::vector<std::string> GetArgvs() {
FilePath GetCurrentExecutableName() {
FilePath result;

auto args = GetArgvs();
if (!args.empty()) {
#if defined(GTEST_OS_WINDOWS) || defined(GTEST_OS_OS2)
result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
result.Set(FilePath(args[0]).RemoveExtension("exe"));
#else
result.Set(FilePath(GetArgvs()[0]));
result.Set(FilePath(args[0]));
#endif // GTEST_OS_WINDOWS
}

return result.RemoveDirectoryName();
}
Expand Down Expand Up @@ -6700,17 +6703,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
}

if (remove_flag) {
// Shift the remainder of the argv list left by one. Note
// that argv has (*argc + 1) elements, the last one always being
// NULL. The following loop moves the trailing NULL element as
// well.
for (int j = i; j != *argc; j++) {
argv[j] = argv[j + 1];
// Shift the remainder of the argv list left by one.
for (int j = i + 1; j < *argc; ++j) {
argv[j - 1] = argv[j];
}

// Decrements the argument count.
(*argc)--;

// Terminate the array with nullptr.
argv[*argc] = nullptr;

// We also need to decrement the iterator as we just removed
// an element.
i--;
Expand Down
Loading