summaryrefslogtreecommitdiffstats
path: root/googlemock/test/gmock-matchers_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2593 from ↵Gennadiy Rozental2019-11-261-9/+4
|\ | | | | | | | | | | kuzkry:remove-workaround_msvc-namespace-scope-from-nested-class PiperOrigin-RevId: 282593823
| * remove MSVC workaround: accessing namespace scope from within nested classesrefs/pull/2593/headKrystian Kuzniarek2019-11-221-9/+4
| |
* | Googletest exportAbseil Team2019-11-221-2/+3
|/ | | | | | | | | | | | | Use standard C++11 integer types in gtest-port.h. Remove testing::internal::{Int,Uint}{32,64} in favor of types guaranteed to be in <cstdint> since C++11. Tests for built-in integer type coverage are switched from {Int,Uint}64 to [unsigned] long long, which is guaranteed by C++11 to exist and be at least 64-bit wide. PiperOrigin-RevId: 281565263
* Merge pull request #2444 from kuzkry:remove-GTEST_ARRAY_SIZE_Gennadiy Civil2019-10-221-17/+21
|\ | | | | | | PiperOrigin-RevId: 275842505
| * remove GTEST_ARRAY_SIZE_refs/pull/2444/headKrystian Kuzniarek2019-09-231-15/+17
| | | | | | | | | | | | | | | | | | This macro didn't work when an array was passed to a function by pointer, in which case the information about its size was lost. Better alternatives are: * std::extent<T>::value (compile-time) * std::array<T, N>::size() (compile-time) * std::distance(std::begin(array), std::end(array)) (run-time)
* | Googletest exportAbseil Team2019-10-221-0/+108
| | | | | | | | | | | | Rolling forward IsNan() matcher with fixes in test for -Wconversion issues. Use std::nanf and std::nanl where appropriate. PiperOrigin-RevId: 275523003
* | Googletest exportmisterg2019-10-181-108/+0
| | | | | | | | | | | | Added IsNan matcher PiperOrigin-RevId: 275473218
* | Googletest exportAbseil Team2019-10-171-0/+108
| | | | | | | | | | | | Added IsNan matcher PiperOrigin-RevId: 275278634
* | Googletest exportAbseil Team2019-09-271-0/+10
|/ | | | | | Makes testing::ResultOf() work with non-copyable arguments. PiperOrigin-RevId: 271222632
* restore mistakenly removed iffs in their explicit formrefs/pull/2387/headKrystian Kuzniarek2019-08-201-7/+6
| | | | | Due to confusion arisen from "iff" standing for "if and only if", this commit uses the latter.
* remove custom implementations of std::is_samerefs/pull/2399/headKrystian Kuzniarek2019-08-141-1/+1
|
* fix typosrefs/pull/2356/headKrystian Kuzniarek2019-07-301-3/+3
|
* Fixed issue #2284 (Incompatibility with C++17)refs/pull/2285/headTom Lachecki2019-06-131-2/+2
|
* Merge pull request #2170 from ngie-eign:issue-2146-ver2Gennadiy Civil2019-04-181-10/+13
|\ | | | | | | PiperOrigin-RevId: 244069956
| * clang: fix `-Wsign-conversion` errorsEnji Cooper2019-04-061-9/+11
|/ | | | | | | | | | | Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes #2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportAbseil Team2019-04-011-272/+6
| | | | | | | | Remove support for "global" ::string and ::wstring types. This support existed for legacy codebases that existed from before namespaces where a thing. It is no longer necessary. PiperOrigin-RevId: 241335738
* Fix clang `-Wunused-parameter` warningsrefs/pull/2125/headEnji Cooper2019-02-131-1/+1
| | | | | | Comment out unused method parameters in their relevant definitions. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Fix clang `-Winconsistent-missing-override` warningsEnji Cooper2019-02-131-3/+3
| | | | | | | | `DescribeTo(..)` and `MatchAndExplain(..)` in `gmock-matchers_test` both override virtual methods. Remove the `virtual` keyword and apply `override` to them instead. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Fix -Wunused-private-field issues with clangrefs/pull/2119/headEnji Cooper2019-02-131-0/+2
| | | | | | | Provide dummy accessors for private values that are set in initializers, but not actually used. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportAbseil Team2019-02-121-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix matcher comparisons for std::reference_wrapper. The googletest docs indicate that std::reference_wrapper should be used to for objects that should not be copied by the matcher (in fact, the ByRef() function is basically the same as a call to std::cref). However, for many types (such as std::string), the overloaded operator== will not resolve correctly. Specifically, this is problematic if operator== depends on template argument deduction, where the same type is named on LHS and RHS. Because template argument deduction happens before any implict conversions for purposes of overload resolution, attempting to compare T with std::reference_wrapper<T> simply looks like a comparison of unlike types. For exapmle, std::reference_wrapper<std::string> is implicitly convertible to 'const std::string&', which would be able to choose an overload specialization of operator==. However, the implicit conversion can only happen after template argument deduction for operator==, so a specialization that would other be an applicable overload is never considered. Note also that this change only affects matchers. There are good reasons that matchers may need to transparently hold a std::reference_wrapper. Other comparisons (like EXPECT_EQ, et. al.) don't need to capture a reference: they don't need to defer evaluation (as in googlemock), and they don't need to avoid copies (as the call chain of matchers does). PiperOrigin-RevId: 232499175
* Googletest exportmisterg2019-02-041-4/+4
| | | | | | Mark legacy _TEST_CASE_ macros as deprecated PiperOrigin-RevId: 232303251
* Googletest exportAbseil Team2019-01-141-21/+86
| | | | | | Add move-only argument support to almost all remaining matchers. PiperOrigin-RevId: 229030728
* Googletest exportAbseil Team2019-01-141-63/+0
| | | | | | | Deduplicate testing::ReferenceWrapper with std::reference_wrapper. Minor cleanups in matchers_test. PiperOrigin-RevId: 229022872
* Googletest exportAbseil Team2019-01-021-23/+0
| | | | | | | | Remove the #ifs for old, unsupported and buggy compilers: * old versions of GCC & MSVC * Symbian PiperOrigin-RevId: 227116941
* Googletest exportAbseil Team2018-12-201-42/+2
| | | | | | Unifdef c++11-related macros from googletest now that it requires C++11. PiperOrigin-RevId: 225905601
* Googletest exportAbseil Team2018-12-171-4/+103
| | | | | | Allow container matchers to accept move-only containers. PiperOrigin-RevId: 225667441
* Googletest exportAbseil Team2018-12-121-5/+88
| | | | | | | | | | | | | | The gmock matchers have a concept of MatchAndExpain; where the details of the matching are written to a "result listener". A matcher can avoid creating expensive debug info by checking result_listener->IsInterested(); but, unfortunately, the default matcher code (called from EXPECT_THAT) is always "interested". This change implements EXPECT_THAT matching to first run the matcher in a "not interested" mode; and then run it a second time ("interested") only if the match fails. PiperOrigin-RevId: 225036073
* Googletest exportmisterg2018-12-111-84/+5
| | | | | | rollback of 224929783 PiperOrigin-RevId: 225008559
* Googletest exportAbseil Team2018-12-111-5/+84
| | | | | | | | | | | | | | The gmock matchers have a concept of MatchAndExpain; where the details of the matching are written to a "result listener". A matcher can avoid creating expensive debug info by checking result_listener->IsInterested(); but, unfortunately, the default matcher code (called from EXPECT_THAT) is always "interested". This change implements EXPECT_THAT matching to first run the matcher in a "not interested" mode; and then run it a second time ("interested") only if the match fails. PiperOrigin-RevId: 224929783
* Googletest exportAbseil Team2018-12-041-0/+11
| | | | | | Deduce SizeType for SizeIs() from the return value of the size() member function PiperOrigin-RevId: 223835674
* Googletest exportAbseil Team2018-12-031-14/+7
| | | | | | Applied fixes for ClangTidy modernize-use-override and modernize-use-using. PiperOrigin-RevId: 223800219
* Googletest exportAbseil Team2018-12-031-3/+149
| | | | | | Replace pump'd Args() matcher with variadic templates. PiperOrigin-RevId: 223794430
* Googletest exportmisterg2018-10-311-2/+0
| | | | | | Remove scoped_ptr replace with std::unique_ptr PiperOrigin-RevId: 219291284
* Merge pull request #1941 from barkovv:masterGennadiy Civil2018-10-291-3/+3
|\ | | | | | | PiperOrigin-RevId: 219134349
| * Replaced all NULLs with nullptr in googlemockrefs/pull/1941/headVadim Barkov2018-10-281-3/+3
| |
* | Googletest exportmisterg2018-10-291-26/+6
|/ | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 219129336
* Googletest exportAbseil Team2018-10-261-6/+26
| | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 218618184
* Googletest exportmisterg2018-10-261-26/+6
| | | | | | Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 218571466
* Remove non-variadic pre C++11 AnyOfmisterg2018-10-091-26/+16
| | | | PiperOrigin-RevId: 216411381
* Unconditionally use std::tuple.Abseil Team2018-10-091-48/+45
| | | | | | Remove all mention of TR1 tuple and our own implementation of tuple. PiperOrigin-RevId: 216395043
* Fixing AllOfMatches test, where it properly belongsmisterg2018-10-081-8/+8
| | | | PiperOrigin-RevId: 216193701
* Remove non-variadic pre C++11 AllOfmisterg2018-10-081-58/+37
| | | | PiperOrigin-RevId: 216183352
* Apply clang-tidy modernize-use-nullptr to googletest.Abseil Team2018-10-051-62/+62
| | | | | | | | | | | Now that googletest has moved to C++11, it should no longer use NULL or 0 for the null pointer. This patch converts all such usages to nullptr using clang-tidy. This prevents LLVM from issuing -Wzero-as-null-pointer-constant warnings. PiperOrigin-RevId: 215814400
* Googletest exportrefs/pull/1837/headAbseil Team2018-09-141-10/+29
| | | | | | | | | Treat default-constructed string_view same as constructed from "". In the context of string comparison (e.g. HasSubstr, StartsWith, EndsWith, etc.), a default-constructed string_view (nullptr) should be semantically same as a empty string "". PiperOrigin-RevId: 212816839
* No longer require a functor passed to ResultOf matcher to define `result_of` ↵Abseil Team2018-08-271-0/+18
| | | | | | | | | type. This makes ResultOf more convenient to use. In particular, the matcher now accepts lambdas. PiperOrigin-RevId: 210118509
* Comments changes, no functionality changesrefs/pull/1740/headGennadiy Civil2018-08-141-2/+1
|
* code mergerefs/pull/1676/headGennadiy Civil2018-07-201-1/+4
|
* code syncGennadiy Civil2018-07-191-0/+1
|
* Code syncGennadiy Civil2018-07-181-3/+20
|
* Fix gmock not building when -fno-rttiScott Graham2018-05-021-4/+2
| | | | Fixes issue #1554. This is internal cl/195020996.