#include <gmock-matchers.h>
template<typename Container>
class testing::internal::ElementsAreMatcherImpl< Container >
Definition at line 3108 of file gmock-matchers.h.
◆ Element
template<typename Container >
◆ StlContainer
template<typename Container >
◆ StlContainerReference
template<typename Container >
◆ View
template<typename Container >
◆ ElementsAreMatcherImpl()
template<typename Container >
template<typename InputIter >
Definition at line 3119 of file gmock-matchers.h.
3120 while (first != last) {
3121 matchers_.push_back(MatcherCast<const Element&>(*first++));
◆ DescribeNegationTo()
template<typename Container >
Reimplemented from testing::MatcherDescriberInterface.
Definition at line 3145 of file gmock-matchers.h.
3147 *os <<
"isn't empty";
3151 *os <<
"doesn't have " << Elements(count()) <<
", or\n";
3152 for (
size_t i = 0; i != count(); ++i) {
3153 *os <<
"element #" << i <<
" ";
3154 matchers_[i].DescribeNegationTo(os);
3155 if (i + 1 < count()) {
◆ DescribeTo()
template<typename Container >
Implements testing::MatcherDescriberInterface.
Definition at line 3126 of file gmock-matchers.h.
3129 }
else if (count() == 1) {
3130 *os <<
"has 1 element that ";
3131 matchers_[0].DescribeTo(os);
3133 *os <<
"has " << Elements(count()) <<
" where\n";
3134 for (
size_t i = 0; i != count(); ++i) {
3135 *os <<
"element #" << i <<
" ";
3136 matchers_[i].DescribeTo(os);
3137 if (i + 1 < count()) {
◆ GTEST_REMOVE_REFERENCE_AND_CONST_()
template<typename Container >
◆ MatchAndExplain()
template<typename Container >
Implements testing::MatcherInterface< Container >.
Definition at line 3161 of file gmock-matchers.h.
3166 const bool listener_interested = listener->IsInterested();
3169 ::std::vector<internal::string> explanations(count());
3171 typename StlContainer::const_iterator it = stl_container.begin();
3172 size_t exam_pos = 0;
3173 bool mismatch_found =
false;
3178 for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
3180 if (listener_interested) {
3181 StringMatchResultListener s;
3182 match = matchers_[exam_pos].MatchAndExplain(*it, &s);
3183 explanations[exam_pos] = s.str();
3185 match = matchers_[exam_pos].Matches(*it);
3189 mismatch_found =
true;
3198 size_t actual_count = exam_pos;
3199 for (; it != stl_container.end(); ++it) {
3203 if (actual_count != count()) {
3208 if (listener_interested && (actual_count != 0)) {
3209 *listener <<
"which has " << Elements(actual_count);
3214 if (mismatch_found) {
3216 if (listener_interested) {
3217 *listener <<
"whose element #" << exam_pos <<
" doesn't match";
3225 if (listener_interested) {
3226 bool reason_printed =
false;
3227 for (
size_t i = 0; i != count(); ++i) {
3230 if (reason_printed) {
3231 *listener <<
",\nand ";
3233 *listener <<
"whose element #" << i <<
" matches, " << s;
3234 reason_printed =
true;
View::const_reference StlContainerReference
static const_reference ConstReference(const RawContainer &container)
void PrintIfNotEmpty(const internal::string &explanation, ::std::ostream *os)
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/electroneum-4.0.0.0/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h