GeezerVison is showing github.com — deps: update googletest to ec4fed9 · nodejs/node@ed1d047
File treeExpand file treeCollapse file tree Open diff view settings doc/contributing/maintaining
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-assertion-result.h +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,7 @@ class GTEST_API_ AssertionResult { | 181 | 181 | // assertion's expectation). When nothing has been streamed into the | 182 | 182 | // object, returns an empty string. | 183 | 183 | const char* message() const { | 184 | | - return message_.get() != nullptr ? message_->c_str() : ""; | | 184 | + return message_ != nullptr ? message_->c_str() : ""; | 185 | 185 | } | 186 | 186 | // Deprecated; please use message() instead. | 187 | 187 | const char* failure_message() const { return message(); } | @@ -204,7 +204,7 @@ class GTEST_API_ AssertionResult { | 204 | 204 | private: | 205 | 205 | // Appends the contents of message to message_. | 206 | 206 | void AppendMessage(const Message& a_message) { | 207 | | - if (message_.get() == nullptr) message_.reset(new ::std::string); | | 207 | + if (message_ == nullptr) message_ = ::std::make_unique<::std::string>(); | 208 | 208 | message_->append(a_message.GetString().c_str()); | 209 | 209 | } | 210 | 210 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-death-test.h +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,7 @@ GTEST_DECLARE_string_(death_test_style); | 51 | 51 |
| 52 | 52 | namespace testing { | 53 | 53 |
| 54 | | -#if GTEST_HAS_DEATH_TEST | | 54 | +#ifdef GTEST_HAS_DEATH_TEST | 55 | 55 |
| 56 | 56 | namespace internal { | 57 | 57 |
| @@ -203,7 +203,7 @@ class GTEST_API_ ExitedWithCode { | 203 | 203 | const int exit_code_; | 204 | 204 | }; | 205 | 205 |
| 206 | | -#if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA | | 206 | +#if !defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_FUCHSIA) | 207 | 207 | // Tests that an exit code describes an exit due to termination by a | 208 | 208 | // given signal. | 209 | 209 | class GTEST_API_ KilledBySignal { | @@ -328,7 +328,7 @@ class GTEST_API_ KilledBySignal { | 328 | 328 | // death tests are supported; otherwise they just issue a warning. This is | 329 | 329 | // useful when you are combining death test assertions with normal test | 330 | 330 | // assertions in one test. | 331 | | -#if GTEST_HAS_DEATH_TEST | | 331 | +#ifdef GTEST_HAS_DEATH_TEST | 332 | 332 | #define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ | 333 | 333 | EXPECT_DEATH(statement, regex) | 334 | 334 | #define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ | |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-matchers.h +22-55Lines changed: 22 additions & 55 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 40 | 40 | #define GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_ | 41 | 41 |
| 42 | 42 | #include <atomic> | | 43 | +#include <functional> | 43 | 44 | #include <memory> | 44 | 45 | #include <ostream> | 45 | 46 | #include <string> | @@ -106,13 +107,13 @@ class MatchResultListener { | 106 | 107 | MatchResultListener& operator=(const MatchResultListener&) = delete; | 107 | 108 | }; | 108 | 109 |
| 109 | | -inline MatchResultListener::~MatchResultListener() {} | | 110 | +inline MatchResultListener::~MatchResultListener() = default; | 110 | 111 |
| 111 | 112 | // An instance of a subclass of this knows how to describe itself as a | 112 | 113 | // matcher. | 113 | 114 | class GTEST_API_ MatcherDescriberInterface { | 114 | 115 | public: | 115 | | - virtual ~MatcherDescriberInterface() {} | | 116 | + virtual ~MatcherDescriberInterface() = default; | 116 | 117 |
| 117 | 118 | // Describes this matcher to an ostream. The function should print | 118 | 119 | // a verb phrase that describes the property a value matching this | @@ -178,43 +179,6 @@ class MatcherInterface : public MatcherDescriberInterface { | 178 | 179 |
| 179 | 180 | namespace internal { | 180 | 181 |
| 181 | | -struct AnyEq { | 182 | | - template <typename A, typename B> | 183 | | - bool operator()(const A& a, const B& b) const { | 184 | | - return a == b; | 185 | | - } | 186 | | -}; | 187 | | -struct AnyNe { | 188 | | - template <typename A, typename B> | 189 | | - bool operator()(const A& a, const B& b) const { | 190 | | - return a != b; | 191 | | - } | 192 | | -}; | 193 | | -struct AnyLt { | 194 | | - template <typename A, typename B> | 195 | | - bool operator()(const A& a, const B& b) const { | 196 | | - return a < b; | 197 | | - } | 198 | | -}; | 199 | | -struct AnyGt { | 200 | | - template <typename A, typename B> | 201 | | - bool operator()(const A& a, const B& b) const { | 202 | | - return a > b; | 203 | | - } | 204 | | -}; | 205 | | -struct AnyLe { | 206 | | - template <typename A, typename B> | 207 | | - bool operator()(const A& a, const B& b) const { | 208 | | - return a <= b; | 209 | | - } | 210 | | -}; | 211 | | -struct AnyGe { | 212 | | - template <typename A, typename B> | 213 | | - bool operator()(const A& a, const B& b) const { | 214 | | - return a >= b; | 215 | | - } | 216 | | -}; | 217 | | - | 218 | 182 | // A match result listener that ignores the explanation. | 219 | 183 | class DummyMatchResultListener : public MatchResultListener { | 220 | 184 | public: | @@ -530,7 +494,7 @@ template <> | 530 | 494 | class GTEST_API_ Matcher<const std::string&> | 531 | 495 | : public internal::MatcherBase<const std::string&> { | 532 | 496 | public: | 533 | | - Matcher() {} | | 497 | + Matcher() = default; | 534 | 498 |
| 535 | 499 | explicit Matcher(const MatcherInterface<const std::string&>* impl) | 536 | 500 | : internal::MatcherBase<const std::string&>(impl) {} | @@ -552,7 +516,7 @@ template <> | 552 | 516 | class GTEST_API_ Matcher<std::string> | 553 | 517 | : public internal::MatcherBase<std::string> { | 554 | 518 | public: | 555 | | - Matcher() {} | | 519 | + Matcher() = default; | 556 | 520 |
| 557 | 521 | explicit Matcher(const MatcherInterface<const std::string&>* impl) | 558 | 522 | : internal::MatcherBase<std::string>(impl) {} | @@ -580,7 +544,7 @@ template <> | 580 | 544 | class GTEST_API_ Matcher<const internal::StringView&> | 581 | 545 | : public internal::MatcherBase<const internal::StringView&> { | 582 | 546 | public: | 583 | | - Matcher() {} | | 547 | + Matcher() = default; | 584 | 548 |
| 585 | 549 | explicit Matcher(const MatcherInterface<const internal::StringView&>* impl) | 586 | 550 | : internal::MatcherBase<const internal::StringView&>(impl) {} | @@ -606,7 +570,7 @@ template <> | 606 | 570 | class GTEST_API_ Matcher<internal::StringView> | 607 | 571 | : public internal::MatcherBase<internal::StringView> { | 608 | 572 | public: | 609 | | - Matcher() {} | | 573 | + Matcher() = default; | 610 | 574 |
| 611 | 575 | explicit Matcher(const MatcherInterface<const internal::StringView&>* impl) | 612 | 576 | : internal::MatcherBase<internal::StringView>(impl) {} | @@ -758,50 +722,53 @@ class ComparisonBase { | 758 | 722 | }; | 759 | 723 |
| 760 | 724 | template <typename Rhs> | 761 | | -class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> { | | 725 | +class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, std::equal_to<>> { | 762 | 726 | public: | 763 | 727 | explicit EqMatcher(const Rhs& rhs) | 764 | | - : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) {} | | 728 | + : ComparisonBase<EqMatcher<Rhs>, Rhs, std::equal_to<>>(rhs) {} | 765 | 729 | static const char* Desc() { return "is equal to"; } | 766 | 730 | static const char* NegatedDesc() { return "isn't equal to"; } | 767 | 731 | }; | 768 | 732 | template <typename Rhs> | 769 | | -class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> { | | 733 | +class NeMatcher | | 734 | + : public ComparisonBase<NeMatcher<Rhs>, Rhs, std::not_equal_to<>> { | 770 | 735 | public: | 771 | 736 | explicit NeMatcher(const Rhs& rhs) | 772 | | - : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) {} | | 737 | + : ComparisonBase<NeMatcher<Rhs>, Rhs, std::not_equal_to<>>(rhs) {} | 773 | 738 | static const char* Desc() { return "isn't equal to"; } | 774 | 739 | static const char* NegatedDesc() { return "is equal to"; } | 775 | 740 | }; | 776 | 741 | template <typename Rhs> | 777 | | -class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> { | | 742 | +class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, std::less<>> { | 778 | 743 | public: | 779 | 744 | explicit LtMatcher(const Rhs& rhs) | 780 | | - : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) {} | | 745 | + : ComparisonBase<LtMatcher<Rhs>, Rhs, std::less<>>(rhs) {} | 781 | 746 | static const char* Desc() { return "is <"; } | 782 | 747 | static const char* NegatedDesc() { return "isn't <"; } | 783 | 748 | }; | 784 | 749 | template <typename Rhs> | 785 | | -class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> { | | 750 | +class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, std::greater<>> { | 786 | 751 | public: | 787 | 752 | explicit GtMatcher(const Rhs& rhs) | 788 | | - : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) {} | | 753 | + : ComparisonBase<GtMatcher<Rhs>, Rhs, std::greater<>>(rhs) {} | 789 | 754 | static const char* Desc() { return "is >"; } | 790 | 755 | static const char* NegatedDesc() { return "isn't >"; } | 791 | 756 | }; | 792 | 757 | template <typename Rhs> | 793 | | -class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> { | | 758 | +class LeMatcher | | 759 | + : public ComparisonBase<LeMatcher<Rhs>, Rhs, std::less_equal<>> { | 794 | 760 | public: | 795 | 761 | explicit LeMatcher(const Rhs& rhs) | 796 | | - : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) {} | | 762 | + : ComparisonBase<LeMatcher<Rhs>, Rhs, std::less_equal<>>(rhs) {} | 797 | 763 | static const char* Desc() { return "is <="; } | 798 | 764 | static const char* NegatedDesc() { return "isn't <="; } | 799 | 765 | }; | 800 | 766 | template <typename Rhs> | 801 | | -class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> { | | 767 | +class GeMatcher | | 768 | + : public ComparisonBase<GeMatcher<Rhs>, Rhs, std::greater_equal<>> { | 802 | 769 | public: | 803 | 770 | explicit GeMatcher(const Rhs& rhs) | 804 | | - : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) {} | | 771 | + : ComparisonBase<GeMatcher<Rhs>, Rhs, std::greater_equal<>>(rhs) {} | 805 | 772 | static const char* Desc() { return "is >="; } | 806 | 773 | static const char* NegatedDesc() { return "isn't >="; } | 807 | 774 | }; | |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-param-test.h +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -449,7 +449,8 @@ internal::ParamConverterGenerator<T> ConvertGenerator( | 449 | 449 |
| 450 | 450 | #define TEST_P(test_suite_name, test_name) \ | 451 | 451 | class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \ | 452 | | - : public test_suite_name, private ::testing::internal::GTestNonCopyable {\ | | 452 | + : public test_suite_name, \ | | 453 | + private ::testing::internal::GTestNonCopyable { \ | 453 | 454 | public: \ | 454 | 455 | GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \ | 455 | 456 | void TestBody() override; \ | |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-printers.h +20-12Lines changed: 20 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -206,12 +206,13 @@ struct StreamPrinter { | 206 | 206 | // Don't accept member pointers here. We'd print them via implicit | 207 | 207 | // conversion to bool, which isn't useful. | 208 | 208 | typename = typename std::enable_if< | 209 | | - !std::is_member_pointer<T>::value>::type, | 210 | | - // Only accept types for which we can find a streaming operator via | 211 | | - // ADL (possibly involving implicit conversions). | 212 | | - typename = decltype(std::declval<std::ostream&>() | 213 | | - << std::declval<const T&>())> | 214 | | - static void PrintValue(const T& value, ::std::ostream* os) { | | 209 | + !std::is_member_pointer<T>::value>::type> | | 210 | + // Only accept types for which we can find a streaming operator via | | 211 | + // ADL (possibly involving implicit conversions). | | 212 | + // (Use SFINAE via return type, because it seems GCC < 12 doesn't handle name | | 213 | + // lookup properly when we do it in the template parameter list.) | | 214 | + static auto PrintValue(const T& value, ::std::ostream* os) | | 215 | + -> decltype((void)(*os << value)) { | 215 | 216 | // Call streaming operator found by ADL, possibly with implicit conversions | 216 | 217 | // of the arguments. | 217 | 218 | *os << value; | @@ -306,9 +307,10 @@ template <typename T> | 306 | 307 | void PrintWithFallback(const T& value, ::std::ostream* os) { | 307 | 308 | using Printer = typename FindFirstPrinter< | 308 | 309 | T, void, ContainerPrinter, FunctionPointerPrinter, PointerPrinter, | | 310 | + ProtobufPrinter, | 309 | 311 | internal_stream_operator_without_lexical_name_lookup::StreamPrinter, | 310 | | - ProtobufPrinter, ConvertibleToIntegerPrinter, | 311 | | - ConvertibleToStringViewPrinter, RawBytesPrinter, FallbackPrinter>::type; | | 312 | + ConvertibleToIntegerPrinter, ConvertibleToStringViewPrinter, | | 313 | + RawBytesPrinter, FallbackPrinter>::type; | 312 | 314 | Printer::PrintValue(value, os); | 313 | 315 | } | 314 | 316 |
| @@ -529,7 +531,10 @@ int AppropriateResolution(FloatType val) { | 529 | 531 | } else if (val >= 0.0001) { | 530 | 532 | mulfor6 = 1e9; | 531 | 533 | } | 532 | | - if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6; | | 534 | + if (static_cast<float>(static_cast<int32_t>(val * mulfor6 + 0.5)) / | | 535 | + mulfor6 == | | 536 | + val) | | 537 | + return 6; | 533 | 538 | } else if (val < 1e10) { | 534 | 539 | FloatType divfor6 = 1.0; | 535 | 540 | if (val >= 1e9) { // 1,000,000,000 to 9,999,999,999 | @@ -541,7 +546,10 @@ int AppropriateResolution(FloatType val) { | 541 | 546 | } else if (val >= 1e6) { // 1,000,000 to 9,999,999 | 542 | 547 | divfor6 = 10; | 543 | 548 | } | 544 | | - if (static_cast<int32_t>(val / divfor6 + 0.5) * divfor6 == val) return 6; | | 549 | + if (static_cast<float>(static_cast<int32_t>(val / divfor6 + 0.5)) * | | 550 | + divfor6 == | | 551 | + val) | | 552 | + return 6; | 545 | 553 | } | 546 | 554 | return full; | 547 | 555 | } | @@ -850,7 +858,7 @@ class UniversalPrinter<Variant<T...>> { | 850 | 858 | public: | 851 | 859 | static void Print(const Variant<T...>& value, ::std::ostream* os) { | 852 | 860 | *os << '('; | 853 | | -#if GTEST_HAS_ABSL | | 861 | +#ifdef GTEST_HAS_ABSL | 854 | 862 | absl::visit(Visitor{os, value.index()}, value); | 855 | 863 | #else | 856 | 864 | std::visit(Visitor{os, value.index()}, value); | @@ -996,7 +1004,7 @@ template <> | 996 | 1004 | class UniversalTersePrinter<char*> : public UniversalTersePrinter<const char*> { | 997 | 1005 | }; | 998 | 1006 |
| 999 | | -#ifdef __cpp_char8_t | | 1007 | +#ifdef __cpp_lib_char8_t | 1000 | 1008 | template <> | 1001 | 1009 | class UniversalTersePrinter<const char8_t*> { | 1002 | 1010 | public: | |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-test-part.h +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -133,7 +133,7 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result); | 133 | 133 | // virtual. | 134 | 134 | class GTEST_API_ TestPartResultArray { | 135 | 135 | public: | 136 | | - TestPartResultArray() {} | | 136 | + TestPartResultArray() = default; | 137 | 137 |
| 138 | 138 | // Appends the given TestPartResult to the array. | 139 | 139 | void Append(const TestPartResult& result); | @@ -154,7 +154,7 @@ class GTEST_API_ TestPartResultArray { | 154 | 154 | // This interface knows how to report a test part result. | 155 | 155 | class GTEST_API_ TestPartResultReporterInterface { | 156 | 156 | public: | 157 | | - virtual ~TestPartResultReporterInterface() {} | | 157 | + virtual ~TestPartResultReporterInterface() = default; | 158 | 158 |
| 159 | 159 | virtual void ReportTestPartResult(const TestPartResult& result) = 0; | 160 | 160 | }; | |
Collapse file Copy file name to clipboardExpand all lines: deps/googletest/include/gtest/gtest-typed-test.h +17-17Lines changed: 17 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -267,28 +267,28 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); | 267 | 267 | TYPED_TEST_SUITE_P | 268 | 268 | #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ | 269 | 269 |
| 270 | | -#define TYPED_TEST_P(SuiteName, TestName) \ | 271 | | - namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ | 272 | | - template <typename gtest_TypeParam_> \ | 273 | | - class TestName : public SuiteName<gtest_TypeParam_> { \ | 274 | | - private: \ | 275 | | - typedef SuiteName<gtest_TypeParam_> TestFixture; \ | 276 | | - typedef gtest_TypeParam_ TypeParam; \ | 277 | | - void TestBody() override; \ | 278 | | - }; \ | 279 | | - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ | 280 | | - GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ | 281 | | - __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \ | 282 | | - GTEST_STRINGIFY_(TestName)); \ | 283 | | - } \ | 284 | | - template <typename gtest_TypeParam_> \ | 285 | | - void GTEST_SUITE_NAMESPACE_( \ | | 270 | +#define TYPED_TEST_P(SuiteName, TestName) \ | | 271 | + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ | | 272 | + template <typename gtest_TypeParam_> \ | | 273 | + class TestName : public SuiteName<gtest_TypeParam_> { \ | | 274 | + private: \ | | 275 | + typedef SuiteName<gtest_TypeParam_> TestFixture; \ | | 276 | + typedef gtest_TypeParam_ TypeParam; \ | | 277 | + void TestBody() override; \ | | 278 | + }; \ | | 279 | + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ | | 280 | + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ | | 281 | + __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \ | | 282 | + GTEST_STRINGIFY_(TestName)); \ | | 283 | + } \ | | 284 | + template <typename gtest_TypeParam_> \ | | 285 | + void GTEST_SUITE_NAMESPACE_( \ | 286 | 286 | SuiteName)::TestName<gtest_TypeParam_>::TestBody() | 287 | 287 |
| 288 | 288 | // Note: this won't work correctly if the trailing arguments are macros. | 289 | 289 | #define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \ | 290 | 290 | namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ | 291 | | - typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \ | | 291 | + typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \ | 292 | 292 | } \ | 293 | 293 | static const char* const GTEST_REGISTERED_TEST_NAMES_( \ | 294 | 294 | SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \ | |
|