Lines Matching refs:Container
1926 // Implements an equality matcher for any STL-style container whose elements
1928 // more detailed information that is useful when the container is used as a set.
1934 // Uses the container's const_iterator, value_type, operator ==,
1936 template <typename Container>
1939 typedef internal::StlContainerView<Container> View;
1945 explicit ContainerEqMatcher(const Container& rhs) : rhs_(View::Copy(rhs)) {
1948 (void)testing::StaticAssertTypeEq<Container,
1949 GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
2102 // container and the RHS container respectively.
2210 template <typename Container>
2211 class QuantifierMatcherImpl : public MatcherInterface<Container> {
2213 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
2225 // * All elements in the container match, if all_elements_should_match.
2226 // * Any element in the container matches, if !all_elements_should_match.
2228 Container container,
2230 StlContainerReference stl_container = View::ConstReference(container);
2253 // Implements Contains(element_matcher) for the given argument type Container.
2255 template <typename Container>
2256 class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
2260 : QuantifierMatcherImpl<Container>(inner_matcher) {}
2273 virtual bool MatchAndExplain(Container container,
2275 return this->MatchAndExplainImpl(false, container, listener);
2282 // Implements Each(element_matcher) for the given argument type Container.
2284 template <typename Container>
2285 class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
2289 : QuantifierMatcherImpl<Container>(inner_matcher) {}
2302 virtual bool MatchAndExplain(Container container,
2304 return this->MatchAndExplainImpl(true, container, listener);
2317 template <typename Container>
2318 operator Matcher<Container>() const {
2319 Container>(inner_matcher_));
2334 template <typename Container>
2335 operator Matcher<Container>() const {
2336 return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));
2518 template <typename Container>
2519 class ElementsAreMatcherImpl : public MatcherInterface<Container> {
2521 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
2574 virtual bool MatchAndExplain(Container container,
2576 StlContainerReference stl_container = View::ConstReference(container);
2579 // The element count doesn't match. If the container is empty,
2581 // prints the empty container. Otherwise we just need to show
2597 // The container has the right size but the i-th element
2638 template <typename Container>
2639 operator Matcher<Container>() const {
2640 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
2645 return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 0));
2656 template <typename Container>
2657 operator Matcher<Container>() const {
2658 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
2662 return MakeMatcher(new ElementsAreMatcherImpl<Container>(first_, count_));
3038 // Returns a matcher that matches an equal container.
3040 // values that are included in one container but not the other. (Duplicate
3042 template <typename Container>
3044 GTEST_REMOVE_CONST_(Container)> >
3045 ContainerEq(const Container& rhs) {
3047 // which causes Container to be a const type sometimes.
3048 typedef GTEST_REMOVE_CONST_(Container) RawContainer;
3053 // Returns a matcher that matches a container that, when sorted using
3063 // Returns a matcher that matches a container that, when sorted using
3073 // Matches an STL-style container or a native array that contains the
3078 // LHS container and the RHS container respectively.
3079 template <typename TupleMatcher, typename Container>
3081 GTEST_REMOVE_CONST_(Container)>
3082 Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
3084 // which causes Container to be a const type sometimes.
3085 typedef GTEST_REMOVE_CONST_(Container) RawContainer;
3090 // Matches an STL-style container or a native array that contains at
3113 // Matches an STL-style container or a native array that contains only
3121 // // Each(m) matches an empty container, regardless of what m is.