diff options
author | Abseil Team <absl-team@google.com> | 2022-04-26 16:48:24 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-04-26 16:49:03 (GMT) |
commit | 238e4745c62258ca1d2f3c514789205e8419eeee (patch) | |
tree | 9e65c6e2ae24921c5c3b9248b9e57345677d4d75 /googlemock/test/gmock-matchers-misc_test.cc | |
parent | 0498660ea575bfeb4b3b0879fa6aa6904d1df373 (diff) | |
download | googletest-238e4745c62258ca1d2f3c514789205e8419eeee.zip googletest-238e4745c62258ca1d2f3c514789205e8419eeee.tar.gz googletest-238e4745c62258ca1d2f3c514789205e8419eeee.tar.bz2 |
Generalize gmock-matchers_test to handle is_gtest_matcher-style matchers, too.
PiperOrigin-RevId: 444586594
Change-Id: I0de9b40b3773e3047a492f050266967ea935ae3e
Diffstat (limited to 'googlemock/test/gmock-matchers-misc_test.cc')
-rw-r--r-- | googlemock/test/gmock-matchers-misc_test.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/googlemock/test/gmock-matchers-misc_test.cc b/googlemock/test/gmock-matchers-misc_test.cc index efb0059..c68431c 100644 --- a/googlemock/test/gmock-matchers-misc_test.cc +++ b/googlemock/test/gmock-matchers-misc_test.cc @@ -637,7 +637,9 @@ TEST(FormatMatcherDescriptionTest, WorksForEmptyDescription) { FormatMatcherDescription(false, "IsInRange", {"a", "b"}, {"5", "8"})); } -TEST(MatcherTupleTest, ExplainsMatchFailure) { +INSTANTIATE_GTEST_MATCHER_TEST_P(MatcherTupleTest); + +TEST_P(MatcherTupleTestP, ExplainsMatchFailure) { stringstream ss1; ExplainMatchFailureTupleTo( std::make_tuple(Matcher<char>(Eq('a')), GreaterThan(5)), @@ -1378,6 +1380,8 @@ TEST(MatcherPnMacroTest, CanUseMatcherTypedParameterInValue) { // Tests Contains().Times(). +INSTANTIATE_GTEST_MATCHER_TEST_P(ContainsTimes); + TEST(ContainsTimes, ListMatchesWhenElementQuantityMatches) { list<int> some_list; some_list.push_back(3); @@ -1397,7 +1401,7 @@ TEST(ContainsTimes, ListMatchesWhenElementQuantityMatches) { EXPECT_THAT(list<int>{}, Not(Contains(_))); } -TEST(ContainsTimes, ExplainsMatchResultCorrectly) { +TEST_P(ContainsTimesP, ExplainsMatchResultCorrectly) { const int a[2] = {1, 2}; Matcher<const int(&)[2]> m = Contains(2).Times(3); EXPECT_EQ( @@ -1502,6 +1506,8 @@ TEST(AllOfArrayTest, Matchers) { EXPECT_THAT(1, AllOfArray({Ge(0), Ge(1)})); } +INSTANTIATE_GTEST_MATCHER_TEST_P(AnyOfArrayTest); + TEST(AnyOfArrayTest, BasicForms) { // Iterator std::vector<int> v0{}; @@ -1554,7 +1560,7 @@ TEST(AnyOfArrayTest, Matchers) { EXPECT_THAT(1, Not(AllOfArray({Lt(0), Lt(1)}))); } -TEST(AnyOfArrayTest, ExplainsMatchResultCorrectly) { +TEST_P(AnyOfArrayTestP, ExplainsMatchResultCorrectly) { // AnyOfArray and AllOfArry use the same underlying template-template, // thus it is sufficient to test one here. const std::vector<int> v0{}; |