File tree 2 files changed +17
-17
lines changed 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -3644,23 +3644,6 @@ class UnorderedElementsAreMatcherImpl
3644
3644
AnalyzeElements (stl_container.begin (), stl_container.end (),
3645
3645
&element_printouts, listener);
3646
3646
3647
- if (matrix.LhsSize () == 0 && matrix.RhsSize () == 0 ) {
3648
- return true ;
3649
- }
3650
-
3651
- if (match_flags () == UnorderedMatcherRequire::ExactMatch) {
3652
- if (matrix.LhsSize () != matrix.RhsSize ()) {
3653
- // The element count doesn't match. If the container is empty,
3654
- // there's no need to explain anything as Google Mock already
3655
- // prints the empty container. Otherwise we just need to show
3656
- // how many elements there actually are.
3657
- if (matrix.LhsSize () != 0 && listener->IsInterested ()) {
3658
- *listener << " which has " << Elements (matrix.LhsSize ());
3659
- }
3660
- return false ;
3661
- }
3662
- }
3663
-
3664
3647
return VerifyMatchMatrix (element_printouts, matrix, listener) &&
3665
3648
FindPairing (matrix, listener);
3666
3649
}
Original file line number Diff line number Diff line change @@ -370,6 +370,23 @@ void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
370
370
bool UnorderedElementsAreMatcherImplBase::VerifyMatchMatrix (
371
371
const ::std::vector<std::string>& element_printouts,
372
372
const MatchMatrix& matrix, MatchResultListener* listener) const {
373
+ if (matrix.LhsSize () == 0 && matrix.RhsSize () == 0 ) {
374
+ return true ;
375
+ }
376
+
377
+ if (match_flags () == UnorderedMatcherRequire::ExactMatch) {
378
+ if (matrix.LhsSize () != matrix.RhsSize ()) {
379
+ // The element count doesn't match. If the container is empty,
380
+ // there's no need to explain anything as Google Mock already
381
+ // prints the empty container. Otherwise we just need to show
382
+ // how many elements there actually are.
383
+ if (matrix.LhsSize () != 0 && listener->IsInterested ()) {
384
+ *listener << " which has " << Elements (matrix.LhsSize ());
385
+ }
386
+ return false ;
387
+ }
388
+ }
389
+
373
390
bool result = true ;
374
391
::std::vector<char > element_matched (matrix.LhsSize (), 0 );
375
392
::std::vector<char > matcher_matched (matrix.RhsSize (), 0 );
You can’t perform that action at this time.
0 commit comments