diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-09-25 18:55:50 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-09-25 18:55:50 +0000 |
commit | 95b12332c345cee508a8e2b68e007280392506e0 (patch) | |
tree | b913cceb0dc73776234068c5c620df8d9ea3e29c /include/gmock/gmock-generated-matchers.h.pump | |
parent | 2d970ee3bad530703ff24bc3a011390b45cdd293 (diff) | |
download | googletest-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.pump | 15 |
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: |