Eduardo Hernández Guerra
unread,May 27, 2011, 4:42:13 AM5/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google C++ Mocking Framework
I have been using and gtest and gmock for testing embeded SW for a
while, using Green Hills C/C++ compiler (v5). I only had to do minor
modifications to the code to make work, mostly related to OS calls.
However when I try to use the ElementsAreArray() matcher, I get the
following compilation errors:
1>gmock-1.6.0\Include\gmock/gmock-matchers.h(2533): error #276: name
1> followed by "::" must be a class or namespace name
1> typedef typename
internal::StlContainerView<RawContainer>::type::value_type
1> ^
1> detected during instantiation of
1>
"testing::internal::ElementsAreArrayMatcher<T>::operator
1> testing::Matcher<T>() const [with T=uint8_t,
1> Container=const uint8_t *]" at line 70 of
1> "APP\Test\FBFPollTask_UT.cpp"
1>
1>gmock-1.6.0\Include\gmock/gmock-matchers.h(2399): error #276: name
1> followed by "::" must be a class or namespace name
1> typedef typename StlContainer::value_type Element;
1> ^
1> detected during:
1> instantiation of class
1>
"testing::internal::ElementsAreMatcherImpl<Container>
1> [with Container=const uint8_t *]" at line
2536
1> instantiation of
1>
"testing::internal::ElementsAreArrayMatcher<T>::operator
1> testing::Matcher<T>() const [with T=uint8_t,
1> Container=const uint8_t *]" at line 70 of
1> "APP\Test\FBFPollTask_UT.cpp"
1>
1>gmock-1.6.0\Include\gmock/gmock-matchers.h(2451): error #153:
1> expression must have class type
1> const size_t actual_count = stl_container.size();
1> ^
1> detected during instantiation of "bool
1>
testing::internal::ElementsAreMatcherImpl<Container>::Match
1> AndExplain(Container,
testing::MatchResultListener *)
1> const [with Container=const uint8_t *]"
1>
1>gmock-1.6.0\Include\gmock/gmock-matchers.h(2463): error #276: name
1> followed by "::" must be a class or namespace name
1> typename StlContainer::const_iterator it =
stl_container.begin();
1> ^
1> detected during instantiation of "bool
1>
testing::internal::ElementsAreMatcherImpl<Container>::Match
1> AndExplain(Container,
testing::MatchResultListener *)
1> const [with Container=const uint8_t *]"
1>
1>gmock-1.6.0\Include\gmock/gmock-matchers.h(2463): error #153:
1> expression must have class type
1> typename StlContainer::const_iterator it =
stl_container.begin();
1> ^
1> detected during instantiation of "bool
1>
testing::internal::ElementsAreMatcherImpl<Container>::Match
1> AndExplain(Container,
testing::MatchResultListener *)
1> const [with Container=const uint8_t *]"
I've tried to work around these but nothing seems to work. Can you
help?