summaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-matchers.h
Commit message (Collapse)AuthorAgeFilesLines
* Internal Code ChangeAbseil Team2023-03-211-5/+5
| | | | | PiperOrigin-RevId: 518213370 Change-Id: I88d0acc195dadf8d03cd15c8534c721141db14ea
* Internal Code ChangeAbseil Team2023-03-111-0/+1
| | | | | PiperOrigin-RevId: 515855852 Change-Id: I8016eefd45c36089e189bbd1ebbe9fdabe68255b
* [gtest] Drop custom-rolled heterogeneous comparator functors in favor of C++ ↵Lawrence Wolf-Sonkin2023-03-101-6/+7
| | | | | | | | | | standard ones * Standard heterogeneous comparator functors such as `std::equal_to<>` and `std::less<>` [have been available since C++14](https://en.cppreference.com/w/cpp/utility/functional/less_void) * Now that [C++14 is the minimum supported version of C++ in Googletest](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md), let's delete these duplications of the standard library PiperOrigin-RevId: 515743068 Change-Id: I1563a2f94039c3a6688429298555545a922f6d7e
* Fix formatting of C++ filesTom Hughes2023-01-241-4/+3
| | | | | PiperOrigin-RevId: 504325204 Change-Id: Iaa1d6d0ab1dccaaeef26f9cb109d530835499240
* IWYU: Add missing std includesTom Hughes2023-01-051-0/+1
| | | | | PiperOrigin-RevId: 499893032 Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
* Shut up a Clang warning.Abseil Team2022-12-151-1/+6
| | | | | | | | | | | | | | | Clang warns on this pattern because it looks like the author might have meant to use the value of the first part of the comma operator, so it warns that it isn't being used. The cast here signals to Clang that this behavior is intentional. This was discovered while updating gmock in Android. Clang's -Wcomma warning is on by default with either -Wall or -Werror, so users of gmock with those on in combination with -Werror are unable to build without this fix. PiperOrigin-RevId: 495655990 Change-Id: Iaf27e2199669f5b6185a877738234e551b6b6556
* Refactor matrix verification into VerifyMatchMatrix.refs/pull/4082/headAbseil Team2022-12-121-17/+0
| | | | | PiperOrigin-RevId: 494786543 Change-Id: I7769558dd2ca046d8957bf352dc04cfb48ff7c3a
* Make SizeIsMatcher::Impl conform to the contract of MatcherDescriberInterface.Abseil Team2022-11-301-2/+2
| | | | | | | MatcherDescriberInterface specifies that DescribeTo "should print a verb phrase", but "size ..." is not a verb phrase. Currently, ElementsAre(SizeIs(9)) is described as "has 1 element that size is equal to 9". With this change, it will be described as "has 1 element that has a size that is equal to 9". PiperOrigin-RevId: 492022324 Change-Id: I4083335f2419462464957521c1e033643b53b763
* Disables `-Wunused-member-function` and `-Wused-but-marked-unused` that ↵Abseil Team2022-11-291-1/+7
| | | | | | | | trigger via `MOCK_METHOD()` and `EXPECT_THAT()` macros. Fixes: #4052, #4055 PiperOrigin-RevId: 491647393 Change-Id: I8e2ad838156fa8c7e9dccd1740af797e694992b6
* Add support of 19-member structs to gmock UnpackStructImpl.Hardik Vala2022-08-221-0/+5
| | | | | PiperOrigin-RevId: 469171380 Change-Id: Ic75fc0523924e40e620552d4c04b79dad22a68e0
* Merge pull request #3918 from assafpr:master2mainCopybara-Service2022-08-011-1/+1
|\ | | | | | | | | PiperOrigin-RevId: 464586117 Change-Id: Icda62f13b962f7408bb5698ae2b627391257d152
| * Update gmock-matchers.hassafpr2022-06-271-1/+1
| | | | | | branch master changed to main on link
* | Add support of 18-member structs to gmock UnpackStructImpl.refs/pull/3966/headAbseil Team2022-07-291-2/+7
| | | | | | | | | | PiperOrigin-RevId: 463961734 Change-Id: Ib62e320a745c190955f181c1f4f12e4cd407ef22
* | Add support of 17-member structs to gmock UnpackStructImpl.Abseil Team2022-06-291-0/+5
|/ | | | | PiperOrigin-RevId: 458018249 Change-Id: I7df8f75ef5b5a6478e7301f959c221810ff9f0b3
* Fix example of DescribeMatcher to properly support negation.Abseil Team2022-05-031-1/+2
| | | | | PiperOrigin-RevId: 446259163 Change-Id: I3ad5f405f44fc233f5cf5a18a274a9104b5c4ab8
* Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-221-2/+5
| | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* Eliminate the legacy GTEST_COMPILE_ASSERT_ macroDerek Mauro2022-04-211-16/+15
| | | | | PiperOrigin-RevId: 443462203 Change-Id: I0c43f981663a7531ff5da4d4be01fb3d6762273d
* Use ResultOf()'s result_description when explaining match result.Abseil Team2022-04-041-1/+5
| | | | | PiperOrigin-RevId: 439389646 Change-Id: Ie34adcdd2b24378e85962efac53b7bb89ed93803
* Add a 3-arg overload for ResultOf() matcher that takes a description string ↵Abseil Team2022-02-101-6/+37
| | | | | | | for better error messages. PiperOrigin-RevId: 427598749 Change-Id: I8c7a5d7b2dde017641534f1c7eed8dd56c33e845
* Consistently apply IWYU pragmas across googletest and googlemock headersAbseil Team2022-01-181-0/+3
| | | | | PiperOrigin-RevId: 422559250 Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
* Merge pull request #3725 from bsilver8192:remove-another-disallow-assignCopybara-Service2022-01-111-189/+162
|\ | | | | | | | | PiperOrigin-RevId: 421044680 Change-Id: If585089811f1b67eab6f339125c27174ee5bc290
| * Remove another GTEST_DISALLOW_ASSIGN_ that crept inrefs/pull/3725/headBrian2022-01-061-2/+0
|/ | | | | | They were all removed in #2815, but it looks like this one got added from a Google export which missed the update. See #2815 for reasons why removing this is desirable.
* Include the param names in the generated description of the MATCHER_P matchers.Abseil Team2021-12-271-14/+22
| | | | | PiperOrigin-RevId: 418497526 Change-Id: Ie53c3c0810c10a32cbcb941e3ca1ee8fb1ddd9f9
* Merge pull request #3581 from cclauss:codespelldinord2021-10-051-1/+1
|\ | | | | | | PiperOrigin-RevId: 400792845
| * Fix remaining typos discovered by codespellrefs/pull/3581/headChristian Clauss2021-09-241-1/+1
| |
* | Googletest exportAbseil Team2021-09-281-1/+2
|/ | | | | | | | Ensure `.what()` is printed in `ThrowsMessage(...)` to address https://github.com/google/googletest/issues/3582 Closes #3582 PiperOrigin-RevId: 399462851
* Merge pull request #3195 from Inujel:fix-3194dinord2021-09-231-10/+7
|\ | | | | | | PiperOrigin-RevId: 398271948
| * Using auto instead of container::const_iteratorrefs/pull/3195/headJulien JEMINE2020-12-291-10/+7
| |
* | Googletest exportAbseil Team2021-08-041-0/+47
| | | | | | | | | | | | Introduce a new matcher for unescaping Base-64 strings to gmock. PiperOrigin-RevId: 388471904
* | fix: typo codespelling commentrefs/pull/3499/headslowy072021-07-241-1/+1
| |
* | Googletest exportAbseil Team2021-07-221-2/+0
| | | | | | | | | | | | Delete GOOGLETEST_CM.* tags from C++ code. PiperOrigin-RevId: 386268534
* | Googletest exportAbseil Team2021-07-091-0/+1
| | | | | | | | | | | | Suppress a clang-tidy warning in the MATCHER(name, description) macro. PiperOrigin-RevId: 383587271
* | Googletest exportAbseil Team2021-07-071-0/+36
| | | | | | | | | | | | | | | | Add `Conditional` wrapper to gtest This follows an initial proposal for an 'EqIff` matcher. `Conditional` was considered more precise as an EqIff() matcher may suffer from `Iff` not being universally understood. PiperOrigin-RevId: 383407665
* | Googletest exportAbseil Team2021-06-301-6/+122
| | | | | | | | | | | | Implement 'Contains(e).Times(n)' matcher modifier which allows to test for arbitrary occurrences including absence with Times(0). PiperOrigin-RevId: 382210276
* | Merge pull request #3429 from 1KoT1:masterCJ Johnson2021-06-171-8/+8
|\ \ | | | | | | | | | PiperOrigin-RevId: 379625931
| * | feat: make a matcher ElementsAreArray applicable for std rangesrefs/pull/3429/headVasilii Pochkaenko2021-06-151-2/+2
| | |
* | | chore: fix spellingrefs/pull/3364/headJohn Bampton2021-04-151-1/+1
| | |
* | | Googletest exportAbseil Team2021-03-161-3/+3
| | | | | | | | | | | | | | | | | | Internal change PiperOrigin-RevId: 362040448
* | | Googletest exportAbseil Team2021-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Update stale links to `gmock_cook_book.md`. I'm a new googletest user and found these links broken when reading the documentation. PiperOrigin-RevId: 357786392
* | | Googletest exportAbseil Team2021-02-181-3/+3
| | | | | | | | | | | | | | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard, attempt #2 PiperOrigin-RevId: 357056902
* | | Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | | | | | | | | | | | | | Revert include guard fix PiperOrigin-RevId: 356588893
* | | Googletest exportAbseil Team2021-02-111-3/+3
| | | | | | | | | | | | | | | | | | Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard PiperOrigin-RevId: 355882793
* | | Googletest exportAbseil Team2021-01-141-21/+19
| |/ |/| | | | | | | | | | | | | | | | | | | | | Change Matcher<T> to allow binding an implementation by value directly: - Drop the requirement of MatcherInterface. Doing manual type erasure avoid extra layers in many cases. - Avoid the adaptor for `MatcherInterface<T>` and `MatcherInterface<const T&>` mismatch. - Use a small object optimization when possible. This makes things like `_` and `Eq(1)` really cheap and do not require memory allocations. - Migrate some matchers to the new model to speed them up and to test the new framework. More matchers to come in future changes. PiperOrigin-RevId: 350580998
* | Googletest exportAbseil Team2020-12-091-0/+51
| | | | | | | | | | | | Introduce a new `Address` matcher to gmock. PiperOrigin-RevId: 346344591
* | Googletest exportAbseil Team2020-12-071-2/+69
| | | | | | | | | | | | | | | | | | Add a `Pointer` matcher as an analog to `Pointee`. Similar to `Pointee`, `Pointer` works with either raw or smart pointers and allows creating a matcher like Pointer(Eq(foo)) for smart pointers. PiperOrigin-RevId: 346164768
* | Googletest exportAbseil Team2020-11-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GMock: Make Truly explain when it fails I just wrote a test that had a matcher of the form Optional(AllOf( SomeMatcher, SomeOtherMatcher, Truly(SomePredicate))) The predicate failed, the other two matchers succeeded, and I got a hard-to-interpret message saying that the value in the optional "didn't match". Didn't match what? This change improves situations like that slightly by having Truly explain to its result listener when it fails. When there are multiple Trulys in an AllOf, there will be some ambiguity, but it will at least provide more information than right now. PiperOrigin-RevId: 341105141
* | Googletest exportAbseil Team2020-10-301-3/+0
| | | | | | | | | | | | | | | | | | | | Remove obsolete comment about non-const references. They used to be banned by the C++ style guide, but positions shifted, and this comment is no longer up to date. There's another reference (heh) on lines 816-819 to how gmock is a "general framework", with the possible implication that support for non-const references was weird in some way and only there to be "general", but I left it alone because I don't really feel I understand what it's saying. PiperOrigin-RevId: 339323428
* | Googletest exportdmauro2020-10-151-4/+4
| | | | | | | | | | | | | | Fixes build warnings from previous CL Add CMake to internal presubmit to prevent these PiperOrigin-RevId: 337325504
* | Googletest exportAbseil Team2020-10-141-0/+213
| | | | | | | | | | Add ::testing::FieldsAre matcher for objects that support get<> and structured bindings. PiperOrigin-RevId: 337165285
* | Merge pull request #2904 from AmatanHead:throw-matchersvslashg2020-08-241-0/+169
|\ \ | | | | | | | | | PiperOrigin-RevId: 327294137