So I'm back looking at this. Here is my entire test code:
#include "gmock/gmock.h"
#include "gtest/gtest.h"
using ::testing::AtLeast;
using ::testing::Return;
using ::testing::_;
using ::testing::Le;
using ::testing::Ge;
using ::testing::Eq;
using ::testing::NotNull;
using ::testing::IsNull;
using ::testing::AllOf;
using ::testing::InSequence;
using ::testing::Args;
using ::testing::ElementsAre;
using ::testing::ElementsAreArray;
using ::testing::Pointee;
namespace Tests
{
class MockTest
{
public:
MOCK_METHOD2(write, bool(int * data, int length));
};
class MatcherTests: public ::testing::Test
{
protected:
MockTest test;
MatcherTests()
{
}
virtual ~MatcherTests()
{
}
virtual void SetUp()
{
}
virtual void TearDown()
{
}
};
TEST_F(MatcherTests, TestMatcher)
{
int expected[4] = {2, 0, 0xAA, 0x55};
int count = 4;
EXPECT_CALL(test, write(_, 4))
.With(Args<0>(ElementsAre(2, 0, 0xAA, 0x55)))
.Times(1);
test.write(expected, count);
}
}
Here is the compiler results:
make -j 3 all
g++ -MMD -c -o build/test/obj/tests/components/MatcherTest.o tests/
components/MatcherTest.cpp -g -pg --coverage -O0 -Wall -
Dprivate=public -Dprotected=public -DBOARD=ZEUS -D__AVR32_UC3A3256__= -
DSWVERSION=DEV -DPART_NUMBER=501010-000000 -DDEBUG_LOGGING= -Iinclude
-Istaging/include -Itests/mocks
In file included from staging/include/gmock/gmock.h:62:0,
from tests/components/MatcherTest.cpp:1:
staging/include/gmock/gmock-generated-matchers.h: In member function
'testing::internal::ElementsAreMatcher4<T1, T2, T3, T4>::operator
testing::Matcher<T>() const [with Container = const
std::tr1::tuple<int*>&, T1 = int, T2 = int, T3 = int, T4 = int]':
staging/include/gmock/gmock-matchers.h:407:42: instantiated from
'static testing::Matcher<A1> testing::SafeMatcherCastImpl<T>::Cast(M)
[with M = testing::internal::ElementsAreMatcher4<int, int, int, int>,
T = const std::tr1::tuple<int*>&]'
staging/include/gmock/gmock-matchers.h:445:58: instantiated from
'testing::Matcher<A1> testing::SafeMatcherCast(const M&) [with T =
const std::tr1::tuple<int*>&, M =
testing::internal::ElementsAreMatcher4<int, int, int, int>]'
staging/include/gmock/gmock-generated-matchers.h:232:75:
instantiated from 'testing::internal::ArgsMatcherImpl<ArgsTuple, k0,
k1, k2, k3, k4, k5, k6, k7, k8, k9>::ArgsMatcherImpl(const
InnerMatcher&) [with InnerMatcher =
testing::internal::ElementsAreMatcher4<int, int, int, int>, ArgsTuple
= const std::tr1::tuple<int*, int>&, int k0 = 0, int k1 =
-0x000000001, int k2 = -0x000000001, int k3 = -0x000000001, int k4 =
-0x000000001, int k5 = -0x000000001, int k6 = -0x000000001, int k7 =
-0x000000001, int k8 = -0x000000001, int k9 = -0x000000001]'
staging/include/gmock/gmock-generated-matchers.h:300:40:
instantiated from 'testing::internal::ArgsMatcher<InnerMatcher, k0,
k1, k2, k3, k4, k5, k6, k7, k8, k9>::operator testing::Matcher<T>()
const [with ArgsTuple = const std::tr1::tuple<int*, int>&,
InnerMatcher = testing::internal::ElementsAreMatcher4<int, int, int,
int>, int k0 = 0, int k1 = -0x000000001, int k2 = -0x000000001, int k3
= -0x000000001, int k4 = -0x000000001, int k5 = -0x000000001, int k6 =
-0x000000001, int k7 = -0x000000001, int k8 = -0x000000001, int k9 =
-0x000000001]'
tests/components/MatcherTest.cpp:56:57: instantiated from here
staging/include/gmock/gmock-generated-matchers.h:408:9: error: no type
named 'value_type' in 'class
testing::internal::StlContainerView<std::tr1::tuple<int*> >::type'
staging/include/gmock/gmock-generated-matchers.h:410:44: error: no
type named 'value_type' in 'class
testing::internal::StlContainerView<std::tr1::tuple<int*> >::type'
staging/include/gmock/gmock-generated-matchers.h:410:44: error: no
type named 'value_type' in 'class
testing::internal::StlContainerView<std::tr1::tuple<int*> >::type'
In file included from staging/include/gmock/gmock-spec-builders.h:
71:0,
from staging/include/gmock/gmock-generated-function-
mockers.h:41,
from staging/include/gmock/gmock.h:61,
from tests/components/MatcherTest.cpp:1:
staging/include/gmock/gmock-matchers.h: At global scope:
staging/include/gmock/gmock-matchers.h: In instantiation of
'testing::internal::ElementsAreMatcherImpl<const
std::tr1::tuple<int*>&>':
staging/include/gmock/gmock-generated-matchers.h:417:74:
instantiated from 'testing::internal::ElementsAreMatcher4<T1, T2, T3,
T4>::operator testing::Matcher<T>() const [with Container = const
std::tr1::tuple<int*>&, T1 = int, T2 = int, T3 = int, T4 = int]'
staging/include/gmock/gmock-matchers.h:407:42: instantiated from
'static testing::Matcher<A1> testing::SafeMatcherCastImpl<T>::Cast(M)
[with M = testing::internal::ElementsAreMatcher4<int, int, int, int>,
T = const std::tr1::tuple<int*>&]'
staging/include/gmock/gmock-matchers.h:445:58: instantiated from
'testing::Matcher<A1> testing::SafeMatcherCast(const M&) [with T =
const std::tr1::tuple<int*>&, M =
testing::internal::ElementsAreMatcher4<int, int, int, int>]'
staging/include/gmock/gmock-generated-matchers.h:232:75:
instantiated from 'testing::internal::ArgsMatcherImpl<ArgsTuple, k0,
k1, k2, k3, k4, k5, k6, k7, k8, k9>::ArgsMatcherImpl(const
InnerMatcher&) [with InnerMatcher =
testing::internal::ElementsAreMatcher4<int, int, int, int>, ArgsTuple
= const std::tr1::tuple<int*, int>&, int k0 = 0, int k1 =
-0x000000001, int k2 = -0x000000001, int k3 = -0x000000001, int k4 =
-0x000000001, int k5 = -0x000000001, int k6 = -0x000000001, int k7 =
-0x000000001, int k8 = -0x000000001, int k9 = -0x000000001]'
staging/include/gmock/gmock-generated-matchers.h:300:40:
instantiated from 'testing::internal::ArgsMatcher<InnerMatcher, k0,
k1, k2, k3, k4, k5, k6, k7, k8, k9>::operator testing::Matcher<T>()
const [with ArgsTuple = const std::tr1::tuple<int*, int>&,
InnerMatcher = testing::internal::ElementsAreMatcher4<int, int, int,
int>, int k0 = 0, int k1 = -0x000000001, int k2 = -0x000000001, int k3
= -0x000000001, int k4 = -0x000000001, int k5 = -0x000000001, int k6 =
-0x000000001, int k7 = -0x000000001, int k8 = -0x000000001, int k9 =
-0x000000001]'
tests/components/MatcherTest.cpp:56:57: instantiated from here
staging/include/gmock/gmock-matchers.h:2200:45: error: no type named
'value_type' in 'class testing::internal::ElementsAreMatcherImpl<const
std::tr1::tuple<int*>&>::StlContainer'
staging/include/gmock/gmock-matchers.h:2303:41: error: no type named
'value_type' in 'class
testing::internal::StlContainerView<std::tr1::tuple<int*> >::type'
staging/include/gmock/gmock-generated-matchers.h: In member function
'testing::internal::ElementsAreMatcher4<T1, T2, T3, T4>::operator
testing::Matcher<T>() const [with Container = const
std::tr1::tuple<int*>&, T1 = int, T2 = int, T3 = int, T4 = int]':
staging/include/gmock/gmock-generated-matchers.h:418:3: warning:
control reaches end of non-void function
make: *** [build/test/obj/tests/components/MatcherTest.o] Error 1
Any ideas why I'm getting these errors?