diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/googletest/src/googlemock | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-c30a6232df03e1efbd9f3b226777b07e087a1122.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/googletest/src/googlemock')
5 files changed, 24 insertions, 6 deletions
diff --git a/chromium/third_party/googletest/src/googlemock/CMakeLists.txt b/chromium/third_party/googletest/src/googlemock/CMakeLists.txt index 8ab59d7f6cd..079c8c9639e 100644 --- a/chromium/third_party/googletest/src/googlemock/CMakeLists.txt +++ b/chromium/third_party/googletest/src/googlemock/CMakeLists.txt @@ -100,8 +100,10 @@ if (MSVC) else() cxx_library(gmock "${cxx_strict}" src/gmock-all.cc) target_link_libraries(gmock PUBLIC gtest) + set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION}) cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc) target_link_libraries(gmock_main PUBLIC gmock) + set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) endif() # If the CMake version supports it, attach header directory information # to the targets for when we are part of a parent build (ie being pulled diff --git a/chromium/third_party/googletest/src/googlemock/docs/cheat_sheet.md b/chromium/third_party/googletest/src/googlemock/docs/cheat_sheet.md index 1e0541ba81c..f2fb272356d 100644 --- a/chromium/third_party/googletest/src/googlemock/docs/cheat_sheet.md +++ b/chromium/third_party/googletest/src/googlemock/docs/cheat_sheet.md @@ -239,6 +239,11 @@ A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or | `ASSERT_THAT(actual_value, matcher)` | The same as `EXPECT_THAT(actual_value, matcher)`, except that it generates a **fatal** failure. | <!-- mdformat on --> +**Note:** Although equality matching via `EXPECT_THAT(actual_value, +expected_value)` is supported, prefer to make the comparison explicit via +`EXPECT_THAT(actual_value, Eq(expected_value))` or `EXPECT_EQ(actual_value, +expected_value)`. + Built-in matchers (where `argument` is the function argument, e.g. `actual_value` in the example above, or when used in the context of `EXPECT_CALL(mock_object, method(matchers))`, the arguments of `method`) are diff --git a/chromium/third_party/googletest/src/googlemock/docs/community_created_documentation.md b/chromium/third_party/googletest/src/googlemock/docs/community_created_documentation.md new file mode 100644 index 00000000000..dfd87f7a61b --- /dev/null +++ b/chromium/third_party/googletest/src/googlemock/docs/community_created_documentation.md @@ -0,0 +1,9 @@ +# Community-Created Documentation + +go/gunit-community-created-docs + +The following is a list, in no particular order, of links to documentation +created by the Googletest community. + +* [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), + by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) diff --git a/chromium/third_party/googletest/src/googlemock/docs/cook_book.md b/chromium/third_party/googletest/src/googlemock/docs/cook_book.md index 4dbfbe09f78..bffbb3c008e 100644 --- a/chromium/third_party/googletest/src/googlemock/docs/cook_book.md +++ b/chromium/third_party/googletest/src/googlemock/docs/cook_book.md @@ -410,8 +410,8 @@ NOTE: `NiceMock` and `StrictMock` only affects *uninteresting* calls (calls of methods with expectations, but they don't match). See [Understanding Uninteresting vs Unexpected Calls](#uninteresting-vs-unexpected). -There are some caveats though (I dislike them just as much as the next guy, but -sadly they are side effects of C++'s limitations): +There are some caveats though (sadly they are side effects of C++'s +limitations): 1. `NiceMock<MockFoo>` and `StrictMock<MockFoo>` only work for mock methods defined using the `MOCK_METHOD` macro **directly** in the `MockFoo` class. @@ -2686,7 +2686,7 @@ TEST(EventQueueTest, EnqueueEventTest) { EventQueue event_queue(&mock_event_dispatcher); const int32 kEventId = 321; - Notification done; + absl::Notification done; EXPECT_CALL(mock_event_dispatcher, DispatchEvent(kEventId)) .WillOnce(Notify(&done)); diff --git a/chromium/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h b/chromium/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h index 0f30abde890..ecf47c4048a 100644 --- a/chromium/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h +++ b/chromium/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h @@ -1335,15 +1335,17 @@ class ActionHelper { public: template <typename... Ts> static Result Perform(Impl* impl, const std::tuple<Ts...>& args) { - return Apply(impl, args, MakeIndexSequence<sizeof...(Ts)>{}, - MakeIndexSequence<10 - sizeof...(Ts)>{}); + static constexpr size_t kMaxArgs = sizeof...(Ts) <= 10 ? sizeof...(Ts) : 10; + return Apply(impl, args, MakeIndexSequence<kMaxArgs>{}, + MakeIndexSequence<10 - kMaxArgs>{}); } private: template <typename... Ts, std::size_t... tuple_ids, std::size_t... rest_ids> static Result Apply(Impl* impl, const std::tuple<Ts...>& args, IndexSequence<tuple_ids...>, IndexSequence<rest_ids...>) { - return impl->template gmock_PerformImpl<Ts...>( + return impl->template gmock_PerformImpl< + typename std::tuple_element<tuple_ids, std::tuple<Ts...>>::type...>( args, std::get<tuple_ids>(args)..., ((void)rest_ids, ExcessiveArg())...); } |