Skip to content

Commit f3b3bb8

Browse files
deps: update googletest to 5a9c3f9e8d9b90bbbe8feb32902146cb8f7c1757
PR-URL: #61731 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 3819c7f commit f3b3bb8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

deps/googletest/include/gtest/internal/gtest-port.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,13 +1515,13 @@ class [[nodiscard]] ThreadWithParam : public ThreadWithParamBase {
15151515

15161516
ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
15171517
: ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {}
1518-
~ThreadWithParam() override {}
1518+
~ThreadWithParam() override = default;
15191519

15201520
private:
15211521
class RunnableImpl : public Runnable {
15221522
public:
15231523
RunnableImpl(UserThreadFunc* func, T param) : func_(func), param_(param) {}
1524-
~RunnableImpl() override {}
1524+
~RunnableImpl() override = default;
15251525
void Run() override { func_(param_); }
15261526

15271527
private:

deps/googletest/src/gtest-port.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
#include "gtest/gtest-message.h"
9191
#include "gtest/gtest-spi.h"
92+
#include "gtest/gtest.h"
9293
#include "gtest/internal/gtest-internal.h"
9394
#include "gtest/internal/gtest-string.h"
9495
#include "src/gtest-internal-inl.h"
@@ -729,7 +730,7 @@ void RE::Init(const char* regex) {
729730
char* const full_pattern = new char[full_regex_len];
730731

731732
snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
732-
is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0;
733+
int error = regcomp(&full_regex_, full_pattern, reg_flags);
733734
// We want to call regcomp(&partial_regex_, ...) even if the
734735
// previous expression returns false. Otherwise partial_regex_ may
735736
// not be properly initialized can may cause trouble when it's
@@ -738,13 +739,13 @@ void RE::Init(const char* regex) {
738739
// Some implementation of POSIX regex (e.g. on at least some
739740
// versions of Cygwin) doesn't accept the empty string as a valid
740741
// regex. We change it to an equivalent form "()" to be safe.
741-
if (is_valid_) {
742+
if (!error) {
742743
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
743-
is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0;
744+
error = regcomp(&partial_regex_, partial_regex, reg_flags);
744745
}
745-
EXPECT_TRUE(is_valid_)
746-
<< "Regular expression \"" << regex
747-
<< "\" is not a valid POSIX Extended regular expression.";
746+
is_valid_ = error == 0;
747+
EXPECT_EQ(error, 0) << "Regular expression \"" << regex
748+
<< "\" is not a valid POSIX Extended regular expression.";
748749

749750
delete[] full_pattern;
750751
}

0 commit comments

Comments
 (0)