Skip to content

Commit e559ef6

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update googletest to 56efe3983185e3f37e43415d1afa97e3860f187f
PR-URL: #61605 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 300de2b commit e559ef6

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

deps/googletest/include/gtest/gtest-matchers.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
4141

4242
#include <atomic>
43+
#include <cstddef>
4344
#include <functional>
4445
#include <memory>
4546
#include <ostream>
@@ -485,6 +486,15 @@ class [[nodiscard]] Matcher : public internal::MatcherBase<T> {
485486
// Implicit constructor here allows people to write
486487
// EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
487488
Matcher(T value); // NOLINT
489+
490+
// Implicit constructor here allows people to write
491+
// EXPECT_THAT(foo, nullptr) instead of EXPECT_THAT(foo, IsNull()) for smart
492+
// pointer types.
493+
//
494+
// The second argument is needed to avoid capturing literal '0'.
495+
template <typename U>
496+
Matcher(U, // NOLINT
497+
std::enable_if_t<std::is_same_v<U, std::nullptr_t>>* = nullptr);
488498
};
489499

490500
// The following two specializations allow the user to write str
@@ -895,13 +905,21 @@ inline internal::EqMatcher<T> Eq(T x) {
895905
return internal::EqMatcher<T>(x);
896906
}
897907

898-
// Constructs a Matcher<T> from a 'value' of type T. The constructed
908+
// Constructs a Matcher<T> from a 'value' of type T. The constructed
899909
// matcher matches any value that's equal to 'value'.
900910
template <typename T>
901911
Matcher<T>::Matcher(T value) {
902912
*this = Eq(value);
903913
}
904914

915+
// Constructs a Matcher<T> from nullptr. The constructed matcher matches any
916+
// value that is equal to nullptr.
917+
template <typename T>
918+
template <typename U>
919+
Matcher<T>::Matcher(U, std::enable_if_t<std::is_same_v<U, std::nullptr_t>>*) {
920+
*this = Eq(nullptr);
921+
}
922+
905923
// Creates a monomorphic matcher that matches anything with type Lhs
906924
// and equal to rhs. A user may need to use this instead of Eq(...)
907925
// in order to resolve an overloading ambiguity.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ typedef GTestMutexLock MutexLock;
14521452
// without knowing its type.
14531453
class [[nodiscard]] ThreadLocalValueHolderBase {
14541454
public:
1455-
virtual ~ThreadLocalValueHolderBase() {}
1455+
virtual ~ThreadLocalValueHolderBase() = default;
14561456
};
14571457

14581458
// Provides a way for a thread to send notifications to a ThreadLocal
@@ -1466,8 +1466,8 @@ class [[nodiscard]] ThreadLocalBase {
14661466
virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
14671467

14681468
protected:
1469-
ThreadLocalBase() {}
1470-
virtual ~ThreadLocalBase() {}
1469+
ThreadLocalBase() = default;
1470+
virtual ~ThreadLocalBase() = default;
14711471

14721472
private:
14731473
ThreadLocalBase(const ThreadLocalBase&) = delete;
@@ -1496,7 +1496,7 @@ class GTEST_API_ [[nodiscard]] ThreadWithParamBase {
14961496
protected:
14971497
class Runnable {
14981498
public:
1499-
virtual ~Runnable() {}
1499+
virtual ~Runnable() = default;
15001500
virtual void Run() = 0;
15011501
};
15021502

@@ -1515,14 +1515,14 @@ 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-
virtual ~ThreadWithParam() {}
1518+
~ThreadWithParam() override {}
15191519

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

15271527
private:
15281528
UserThreadFunc* const func_;
@@ -1605,8 +1605,8 @@ class [[nodiscard]] ThreadLocal : public ThreadLocalBase {
16051605

16061606
class ValueHolderFactory {
16071607
public:
1608-
ValueHolderFactory() {}
1609-
virtual ~ValueHolderFactory() {}
1608+
ValueHolderFactory() = default;
1609+
virtual ~ValueHolderFactory() = default;
16101610
virtual ValueHolder* MakeNewHolder() const = 0;
16111611

16121612
private:
@@ -1616,7 +1616,7 @@ class [[nodiscard]] ThreadLocal : public ThreadLocalBase {
16161616

16171617
class DefaultValueHolderFactory : public ValueHolderFactory {
16181618
public:
1619-
DefaultValueHolderFactory() {}
1619+
DefaultValueHolderFactory() = default;
16201620
ValueHolder* MakeNewHolder() const override { return new ValueHolder(); }
16211621

16221622
private:

0 commit comments

Comments
 (0)