aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-generated-matchers.h.pump
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-09-25 18:55:50 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-09-25 18:55:50 +0000
commit95b12332c345cee508a8e2b68e007280392506e0 (patch)
treeb913cceb0dc73776234068c5c620df8d9ea3e29c /include/gmock/gmock-generated-matchers.h.pump
parent2d970ee3bad530703ff24bc3a011390b45cdd293 (diff)
downloadgoogletest-95b12332c345cee508a8e2b68e007280392506e0.tar.gz
googletest-95b12332c345cee508a8e2b68e007280392506e0.tar.bz2
googletest-95b12332c345cee508a8e2b68e007280392506e0.zip
Makes gmock work on Symbian (both 3rd & 5th editions), original patch contributed by Mika Raento.
Diffstat (limited to 'include/gmock/gmock-generated-matchers.h.pump')
-rw-r--r--include/gmock/gmock-generated-matchers.h.pump15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/gmock/gmock-generated-matchers.h.pump b/include/gmock/gmock-generated-matchers.h.pump
index 41294b7a..c43aa873 100644
--- a/include/gmock/gmock-generated-matchers.h.pump
+++ b/include/gmock/gmock-generated-matchers.h.pump
@@ -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: