Makes gmock work on Symbian (both 3rd & 5th editions), original patch contributed by Mika Raento.

This commit is contained in:
zhanyong.wan
2009-09-25 18:55:50 +00:00
parent 2d970ee3ba
commit 95b12332c3
9 changed files with 185 additions and 92 deletions

View File

@@ -304,11 +304,15 @@ class ElementsAreMatcher1 {
typedef typename internal::StlContainerView<RawContainer>::type::value_type
Element;
const Matcher<const Element&> matchers[] = {
MatcherCast<const Element&>(e1_),
};
return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, 1));
// Nokia's Symbian Compiler has a nasty bug where the object put
// in a one-element local array is not destructed when the array
// goes out of scope. This leads to obvious badness as we've
// added the linked_ptr in it to our other linked_ptrs list.
// Hence we implement ElementsAreMatcher1 specially to avoid using
// a local array.
const Matcher<const Element&> matcher =
MatcherCast<const Element&>(e1_);
return MakeMatcher(new ElementsAreMatcherImpl<Container>(&matcher, 1));
}
private: