Home | History | Annotate | Download | only in gmock

Lines Matching refs:Container

2399 // Implements a matcher that checks the size of an STL-style container.
2407 template <typename Container>
2408 operator Matcher<Container>() const {
2409 return MakeMatcher(new Impl<Container>(size_matcher_));
2412 template <typename Container>
2413 class Impl : public MatcherInterface<Container> {
2416 GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
2430 virtual bool MatchAndExplain(Container container,
2432 SizeType size = container.size();
2452 // container.
2459 template <typename Container>
2460 operator Matcher<Container>() const {
2461 return MakeMatcher(new Impl<Container>(distance_matcher_));
2464 template <typename Container>
2465 class Impl : public MatcherInterface<Container> {
2468 GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
2484 virtual bool MatchAndExplain(Container container,
2489 DistanceType distance = std::distance(begin(container), end(container));
2491 DistanceType distance = std::distance(container.begin(), container.end());
2512 // Implements an equality matcher for any STL-style container whose elements
2514 // more detailed information that is useful when the container is used as a set.
2520 // Uses the container's const_iterator, value_type, operator ==,
2522 template <typename Container>
2525 typedef internal::StlContainerView<Container> View;
2531 explicit ContainerEqMatcher(const Container& expected)
2535 (void)testing::StaticAssertTypeEq<Container,
2536 GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
2693 // container and the RHS container respectively.
2801 template <typename Container>
2802 class QuantifierMatcherImpl : public MatcherInterface<Container> {
2804 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
2816 // * All elements in the container match, if all_elements_should_match.
2817 // * Any element in the container matches, if !all_elements_should_match.
2819 Container container,
2821 StlContainerReference stl_container = View::ConstReference(container);
2844 // Implements Contains(element_matcher) for the given argument type Container.
2846 template <typename Container>
2847 class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
2851 : QuantifierMatcherImpl<Container>(inner_matcher) {}
2864 virtual bool MatchAndExplain(Container container,
2866 return this->MatchAndExplainImpl(false, container, listener);
2873 // Implements Each(element_matcher) for the given argument type Container.
2875 template <typename Container>
2876 class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
2880 : QuantifierMatcherImpl<Container>(inner_matcher) {}
2893 virtual bool MatchAndExplain(Container container,
2895 return this->MatchAndExplainImpl(true, container, listener);
2908 template <typename Container>
2909 operator Matcher<Container>() const {
2910 return MakeMatcher(new ContainsMatcherImpl<Container>(inner_matcher_));
2925 template <typename Container>
2926 operator Matcher<Container>() const {
2927 return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));
3109 template <typename Container>
3110 class ElementsAreMatcherImpl : public MatcherInterface<Container> {
3112 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
3163 virtual bool MatchAndExplain(Container container,
3172 StlContainerReference stl_container = View::ConstReference(container);
3197 // Find how many elements the actual container has. We avoid
3206 // The element count doesn't match. If the container is empty,
3208 // prints the empty container. Otherwise we just need to show
3345 template <typename Container>
3347 : public MatcherInterface<Container>,
3350 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
3377 virtual bool MatchAndExplain(Container container,
3379 StlContainerReference stl_container = View::ConstReference(container);
3391 // The element count doesn't match. If the container is empty,
3393 // prints the empty container. Otherwise we just need to show
3457 template <typename Container>
3458 operator Matcher<Container>() const {
3459 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
3467 return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
3482 template <typename Container>
3483 operator Matcher<Container>() const {
3484 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
3492 return MakeMatcher(new ElementsAreMatcherImpl<Container>(
3511 template <typename Container>
3512 operator Matcher<Container>() const {
3514 new UnorderedElementsAreMatcherImpl<Container>(matchers_.begin(),
3531 template <typename Container>
3532 operator Matcher<Container>() const {
3533 return MakeMatcher(new ElementsAreMatcherImpl<Container>(
3632 // ElementsAreArray(container)
3664 template <typename Container>
3665 inline internal::ElementsAreArrayMatcher<typename Container::value_type>
3666 ElementsAreArray(const Container& container) {
3667 return ElementsAreArray(container.begin(), container.end());
3681 // UnorderedElementsAreArray(container)
3706 template <typename Container>
3708 typename Container::value_type>
3709 UnorderedElementsAreArray(const Container& container) {
3710 return UnorderedElementsAreArray(container.begin(), container.end());
4137 // Returns a matcher that matches the container size. The container must
4141 // EXPECT_THAT(container, SizeIs(2)); // Checks container has 2 elements.
4142 // EXPECT_THAT(container, SizeIs(Le(2)); // Checks container has at most 2.
4149 // Returns a matcher that matches the distance between the container's begin()
4150 // iterator and its end() iterator, i.e. the size of the container. This matcher
4152 // do not implement size(). The container must provide const_iterator (with
4160 // Returns a matcher that matches an equal container.
4162 // values that are included in one container but not the other. (Duplicate
4164 template <typename Container>
4166 GTEST_REMOVE_CONST_(Container)> >
4167 ContainerEq(const Container& rhs) {
4169 // which causes Container to be a const type sometimes.
4170 typedef GTEST_REMOVE_CONST_(Container) RawContainer;
4175 // Returns a matcher that matches a container that, when sorted using
4185 // Returns a matcher that matches a container that, when sorted using
4195 // Matches an STL-style container or a native array that contains the
4200 // LHS container and the RHS container respectively.
4201 template <typename TupleMatcher, typename Container>
4203 GTEST_REMOVE_CONST_(Container)>
4204 Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
4206 // which causes Container to be a const type sometimes (e.g. when
4208 typedef GTEST_REMOVE_CONST_(Container) RawContainer;
4225 // container or a native array that contains the same number of
4226 // elements as in rhs, where in some permutation of the container, its
4230 // the types of elements in the LHS container and the RHS container
4248 // STL-style container and it being a native C-style array.
4280 // Matches an STL-style container or a native array that contains at
4303 // Matches an STL-style container or a native array that contains only
4311 // // Each(m) matches an empty container, regardless of what m is.