diff options
author | Gennadiy Civil <misterg@google.com> | 2018-01-26 16:57:58 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-01-26 16:57:58 (GMT) |
commit | fbb48a7708fc791ef25096b383791966bbf369f0 (patch) | |
tree | 06f49b8bef466973da1f715f658d9470af7aa263 /googlemock/include/gmock/gmock-more-matchers.h | |
parent | b3a2048beb0f8d6cbb2d5c95e7f639780eff5805 (diff) | |
download | googletest-fbb48a7708fc791ef25096b383791966bbf369f0.zip googletest-fbb48a7708fc791ef25096b383791966bbf369f0.tar.gz googletest-fbb48a7708fc791ef25096b383791966bbf369f0.tar.bz2 |
Code merges
Diffstat (limited to 'googlemock/include/gmock/gmock-more-matchers.h')
-rw-r--r-- | googlemock/include/gmock/gmock-more-matchers.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/googlemock/include/gmock/gmock-more-matchers.h b/googlemock/include/gmock/gmock-more-matchers.h index 3db899f..a5a8bfa 100644 --- a/googlemock/include/gmock/gmock-more-matchers.h +++ b/googlemock/include/gmock/gmock-more-matchers.h @@ -53,6 +53,22 @@ MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") { return false; } +// Define a matcher that matches a value that evaluates in boolean +// context to true. Useful for types that define "explicit operator +// bool" operators and so can't be compared for equality with true +// and false. +MATCHER(IsTrue, negation ? "is false" : "is true") { + return static_cast<bool>(arg); +} + +// Define a matcher that matches a value that evaluates in boolean +// context to false. Useful for types that define "explicit operator +// bool" operators and so can't be compared for equality with true +// and false. +MATCHER(IsFalse, negation ? "is true" : "is false") { + return !static_cast<bool>(arg); +} + } // namespace testing #endif // GMOCK_GMOCK_MORE_MATCHERS_H_ |