aboutsummaryrefslogtreecommitdiffstats
path: root/test/gmock-generated-matchers_test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-07-28 08:24:00 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-07-28 08:24:00 +0000
commitfb25d5391143a0fd4cbce862f19472ddc2a1ecab (patch)
treed6185cc906cf8a1e805f1b6bf0bf40799cf8f0b7 /test/gmock-generated-matchers_test.cc
parent2989703ed85154ae7ef90e0d754590116ecb565d (diff)
downloadgoogletest-fb25d5391143a0fd4cbce862f19472ddc2a1ecab.tar.gz
googletest-fb25d5391143a0fd4cbce862f19472ddc2a1ecab.tar.bz2
googletest-fb25d5391143a0fd4cbce862f19472ddc2a1ecab.zip
Adds matchers UnorderedElementsAre[Array]() (by Billy Donahue); pulls in
gtest r660.
Diffstat (limited to 'test/gmock-generated-matchers_test.cc')
-rw-r--r--test/gmock-generated-matchers_test.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/gmock-generated-matchers_test.cc b/test/gmock-generated-matchers_test.cc
index 0a750de1..e43781b6 100644
--- a/test/gmock-generated-matchers_test.cc
+++ b/test/gmock-generated-matchers_test.cc
@@ -80,6 +80,9 @@ using testing::Value;
using testing::internal::ElementsAreArrayMatcher;
using testing::internal::string;
+// Evaluates to the number of elements in 'array'.
+#define GMOCK_ARRAY_SIZE_(a) (sizeof(a) / sizeof(a[0]))
+
// Returns the description of the given matcher.
template <typename T>
string Describe(const Matcher<T>& m) {
@@ -284,9 +287,6 @@ Matcher<int> GreaterThan(int n) {
// Tests for ElementsAre().
-// Evaluates to the number of elements in 'array'.
-#define GMOCK_ARRAY_SIZE_(array) (sizeof(array)/sizeof(array[0]))
-
TEST(ElementsAreTest, CanDescribeExpectingNoElement) {
Matcher<const vector<int>&> m = ElementsAre();
EXPECT_EQ("is empty", Describe(m));
@@ -563,8 +563,8 @@ TEST(ElementsAreTest, MakesCopyOfArguments) {
int x = 1;
int y = 2;
// This should make a copy of x and y.
- ::testing::internal::ElementsAreMatcher2<int, int> polymorphic_matcher =
- ElementsAre(x, y);
+ ::testing::internal::ElementsAreMatcher<std::tr1::tuple<int, int> >
+ polymorphic_matcher = ElementsAre(x, y);
// Changing x and y now shouldn't affect the meaning of the above matcher.
x = y = 0;
const int array1[] = { 1, 2 };
@@ -573,6 +573,7 @@ TEST(ElementsAreTest, MakesCopyOfArguments) {
EXPECT_THAT(array2, Not(polymorphic_matcher));
}
+
// Tests for ElementsAreArray(). Since ElementsAreArray() shares most
// of the implementation with ElementsAre(), we don't test it as
// thoroughly here.