Skip to content

Commit 65ae1fc

Browse files
nodejs-github-botmarco-ippolito
authored andcommitted
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 c03fedd commit 65ae1fc

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

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

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

15471547
ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
15481548
: ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {}
1549-
~ThreadWithParam() override {}
1549+
~ThreadWithParam() override = default;
15501550

15511551
private:
15521552
class RunnableImpl : public Runnable {
15531553
public:
15541554
RunnableImpl(UserThreadFunc* func, T param) : func_(func), param_(param) {}
1555-
~RunnableImpl() override {}
1555+
~RunnableImpl() override = default;
15561556
void Run() override { func_(param_); }
15571557

15581558
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"
@@ -745,7 +746,7 @@ void RE::Init(const char* regex) {
745746
char* const full_pattern = new char[full_regex_len];
746747

747748
snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
748-
is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0;
749+
int error = regcomp(&full_regex_, full_pattern, reg_flags);
749750
// We want to call regcomp(&partial_regex_, ...) even if the
750751
// previous expression returns false. Otherwise partial_regex_ may
751752
// not be properly initialized can may cause trouble when it's
@@ -754,13 +755,13 @@ void RE::Init(const char* regex) {
754755
// Some implementation of POSIX regex (e.g. on at least some
755756
// versions of Cygwin) doesn't accept the empty string as a valid
756757
// regex. We change it to an equivalent form "()" to be safe.
757-
if (is_valid_) {
758+
if (!error) {
758759
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
759-
is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0;
760+
error = regcomp(&partial_regex_, partial_regex, reg_flags);
760761
}
761-
EXPECT_TRUE(is_valid_)
762-
<< "Regular expression \"" << regex
763-
<< "\" is not a valid POSIX Extended regular expression.";
762+
is_valid_ = error == 0;
763+
EXPECT_EQ(error, 0) << "Regular expression \"" << regex
764+
<< "\" is not a valid POSIX Extended regular expression.";
764765

765766
delete[] full_pattern;
766767
}

0 commit comments

Comments
 (0)