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

@@ -192,6 +192,19 @@ class ElementsAreMatcher$i {
typedef typename internal::StlContainerView<RawContainer>::type::value_type
Element;
$if i==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));
]] $else [[
const Matcher<const Element&> matchers[] = {
$for j [[
@@ -201,6 +214,8 @@ $for j [[
};
return MakeMatcher(new ElementsAreMatcherImpl<Container>(matchers, $i));
]]
}
private: