summaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-spec-builders.h
Commit message (Collapse)AuthorAgeFilesLines
* IWYU: Add missing std includesTom Hughes2023-01-051-0/+1
| | | | | PiperOrigin-RevId: 499893032 Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
* Remove incorrect GTEST_ATTRIBUTE_UNUSED_ from InSequence class.Abseil Team2022-11-081-1/+1
| | | | | | Fixes: #4048 PiperOrigin-RevId: 486951561 Change-Id: I4fae101b5ac5ed4f46c32aba8c36519e1f784db1
* Merge pull request #4041 from zloylos:allow-naming-expectationsCopybara-Service2022-10-251-2/+29
|\ | | | | | | | | PiperOrigin-RevId: 483683590 Change-Id: Id22de3a22018324e5c1e21e262ac5e027a83bf3e
| * Fix format without expectation namerefs/pull/4041/headDenis Hananein2022-10-211-2/+2
| | | | | | | | Signed-off-by: Denis Hananein <i@zloylos.me>
| * Change messagesDenis Hananein2022-10-211-6/+6
| | | | | | | | Signed-off-by: Denis Hananein <i@zloylos.me>
| * Allow naming expectations #3970Denis Hananein2022-10-201-2/+21
|/ | | | Signed-off-by: Denis Hananein <i@zloylos.me>
* Work around a maybe-uninitialized warning under GCC 12Derek Mauro2022-06-011-4/+5
| | | | | | | | | | | Some Mock constructors insert the pointer to the Mock itself into a global registry. Since GCC cannot see how the pointer is used (only as an identifier), it cannot tell that the object doesn't need to be initialized at that point at all. Work around this by using uintptr_t instead. PiperOrigin-RevId: 452380347 Change-Id: Ia5a493057ed90719de1d0efab71de9a8a08ddf8b
* gmock-spec-builders: remove the name for an unused parameter.Aaron Jacobs2022-05-301-7/+1
| | | | | | | | | | | This fixes unused parameter errors under both MSVC and clang (when `-Werror=unused-parameter` is used, as reported [here](https://github.com/google/googletest/commit/9d21db9e0a60a1ea61ec19331c9bc0dd33e907b1#r74769946)). Fixes #3858 PiperOrigin-RevId: 451907906 Change-Id: Ic07da19ea6a547eb1797fbbab19cd57cc2a83fe8
* gmock-spec-builders: add support for non-moveable types.Aaron Jacobs2022-05-271-189/+103
| | | | | | | | | Do this by ripping out the "untyped perform action" machinery, which isn't necessary: we can simply template the entry point on the result type, and use RAII to avoid the need to special case void. This makes it easier to understand the code and harder to introduce type-related undefined behavior, to boot. PiperOrigin-RevId: 451493451 Change-Id: I225305f83164752ca92f2916721972eafba33168
* gmock-spec-builders: move a method to the header.Aaron Jacobs2022-05-261-3/+134
| | | | | | | | In order to make the diff more readable in an upcoming commit that requires the method to be templated on the action's result type. PiperOrigin-RevId: 451157029 Change-Id: I57beb7544efccd0459efb3a1f039ea45cd7c7602
* Support move-only and &&-qualified actions in DoAll.Aaron Jacobs2022-04-261-5/+36
| | | | | | | | This is necessary for generic support of these actions, since `DoAll` is a frequently-used action wrapper. PiperOrigin-RevId: 444561964 Change-Id: I02edb55e35ab4207fbd71e371255a319c8253136
* Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-221-4/+8
| | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* Add support for move-only and &&-qualified actions in WillOnce.Abseil Team2022-04-091-3/+5
| | | | | | | | | | | | This provides a type-safe way for an action to express that it wants to be called only once, or to capture move-only objects. It is a generalization of the type system-evading hack in ByMove, with the improvement that it works for _any_ action (including user-defined ones), and correctly expresses that the action can only be used with WillOnce. I'll make existing actions benefit in a future commit. PiperOrigin-RevId: 440496139 Change-Id: I4145d191cca5655995ef41360bb126c123cb41d3
* Running clang-format over all of GoogleTestAbseil Team2022-03-151-120/+88
| | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* Consistently apply IWYU pragmas across googletest and googlemock headersAbseil Team2022-01-181-1/+3
| | | | | PiperOrigin-RevId: 422559250 Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
* Fix remaining typos discovered by codespellrefs/pull/3581/headChristian Clauss2021-09-241-1/+1
|
* 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-05-131-6/+8
| | | | | | Support templating MockFunction over function objects besides std::function. PiperOrigin-RevId: 373586967
* Googletest exportAbseil Team2021-03-161-3/+3
| | | | | | Internal change PiperOrigin-RevId: 362040448
* 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 Team2020-12-221-8/+14
| | | | | | | | | Give each of Naggy/Nice/StrictMock a base class whose constructor runs before the mocked class's constructor, and a destructor that runs after the mocked class's destructor, so that any mock methods run in either the constructor or destructor use the same strictness as other calls. PiperOrigin-RevId: 348511612
* Fix a -Wdeprecated warning.Arthur O'Dwyer2020-04-241-1/+4
| | | | | | | | gmock-spec-builders.h:503:3: error: definition of implicit copy constructor for 'Expectation' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated] ~Expectation(); ^
* Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.Arthur O'Dwyer2020-04-241-4/+0
| | | | | | | | | | | | | | | | | | | | | | None of these are strictly needed for correctness. A large number of them (maybe all of them?) trigger `-Wdeprecated` warnings on Clang trunk as soon as you try to use the implicitly defaulted (but deprecated) copy constructor of a class that has deleted its copy assignment operator. By declaring a deleted copy assignment operator, the old code also caused the move constructor and move assignment operator to be non-declared. This means that the old code never got move semantics -- "move-construction" would simply call the defaulted (but deprecated) copy constructor instead. With the new code, "move-construction" calls the defaulted move constructor, which I believe is what we want to happen. So this is a runtime performance optimization. Unfortunately we can't yet physically remove the definitions of these macros from gtest-port.h, because they are being used by other code internally at Google (according to zhangxy988). But no new uses should be added going forward.
* Merge pull request #2350 from adambadura:MockFunctionFromStdFunctionXiaoyi Zhang2020-03-241-38/+92
|\ | | | | | | PiperOrigin-RevId: 302677275
| * Add support for std::function in MockFunction (#2277)refs/pull/2350/headAdam Badura2020-03-181-39/+93
|/
* remove MSVC workaround: warning 4355refs/pull/2595/headKrystian Kuzniarek2019-11-221-8/+0
|
* Merge pull request #2387 from kuzkry:iffShaindel Schwartz2019-09-121-16/+19
|\ | | | | | | PiperOrigin-RevId: 268693457
| * restore mistakenly removed iffs in their explicit formrefs/pull/2387/headKrystian Kuzniarek2019-08-201-16/+19
| | | | | | | | | | Due to confusion arisen from "iff" standing for "if and only if", this commit uses the latter.
* | Googletest exportkuzkry2019-09-061-2/+2
|/ | | | | | | | | Merge 7f4f58da20e1066a888d3e4bcbef541db798a605 into 90a443f9c2437ca8a682a1ac625eba64e1d74a8a Closes #2395 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2395 from kuzkry:custom-type-traits-remove_reference 7f4f58da20e1066a888d3e4bcbef541db798a605 PiperOrigin-RevId: 266189044
* remove custom implementations of std::is_samerefs/pull/2399/headKrystian Kuzniarek2019-08-141-3/+3
|
* remove an excessive mutable type specifierrefs/pull/2359/headKrystian Kuzniarek2019-08-011-1/+1
| | | | | MockFunction's private member cannot be reached from outside and all its non-static member functions are not const.
* fix typosrefs/pull/2356/headKrystian Kuzniarek2019-07-301-14/+14
|
* Add missing <functional> includerefs/pull/2332/headAdam Badura2019-07-161-0/+1
| | | | | | | gmock-spec-builders.h uses std::function (in MockFunction) but did not include <functional> to provide it. Apparently, it worked since the header must have been included by something else but better be safe than sorry.
* Googletest exportAbseil Team2019-01-221-1/+1
| | | | | | Make internal FunctionMocker class final PiperOrigin-RevId: 230332778
* Googletest exportAbseil Team2019-01-181-2/+8
| | | | | | | | | | Fix mocking method arguments with templated copy constructors. A previous change removed workarounds for old compilers from googletest and googlemock. Unfortunately, a bit of code that started as a workaround for Symbian's C++ compiler is still needed to avoid copy/move constructor ambiguity when mocking functions with certain argument types. The test case added by this CL is extracted from Chrome's codebase, and was discovered while attempting to roll googletest. PiperOrigin-RevId: 229801765
* Googletest exportmisterg2019-01-021-4/+0
| | | | | | Internal Change PiperOrigin-RevId: 227575279
* Googletest exportAbseil Team2019-01-021-11/+2
| | | | | | | | Remove the #ifs for old, unsupported and buggy compilers: * old versions of GCC & MSVC * Symbian PiperOrigin-RevId: 227116941
* Googletest exportAbseil Team2018-12-031-25/+20
| | | | | | Applied fixes for ClangTidy modernize-use-override and modernize-use-using. PiperOrigin-RevId: 223800219
* Googletest exportAbseil Team2018-11-081-69/+144
| | | | | | Move FunctionMocker and MockFunction out of the pump file and implement with variadic templates. PiperOrigin-RevId: 220640265
* Googletest exportmisterg2018-10-311-1/+1
| | | | | | Remove scoped_ptr replace with std::unique_ptr PiperOrigin-RevId: 219291284
* Merge pull request #1941 from barkovv:masterGennadiy Civil2018-10-291-2/+3
|\ | | | | | | PiperOrigin-RevId: 219134349
| * Replaced all NULLs with nullptr in googlemockrefs/pull/1941/headVadim Barkov2018-10-281-1/+1
| |
* | Googletest exportmisterg2018-10-291-20/+11
|/ | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 219129336
* Googletest exportAbseil Team2018-10-261-11/+20
| | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 218618184
* Googletest exportmisterg2018-10-261-20/+11
| | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 218571466
* Merge pull request #1911 from BrukerJWD:isniceGennadiy Civil2018-10-231-0/+10
|\ | | | | | | PiperOrigin-RevId: 218384341
| * Merge branch 'master' into isniceBrukerJWD2018-10-161-115/+187
| |\