Hi. I am trying to use googlemock to test a parameter that is a c-style array. I have looked at the CookBook and several posts on this group. I've tried to base what I have done on those examples, but I keep getting the same compile error.
Here is a code snippet:
double doubleArray[] = {1.1, 2.2};
Matcher<double> expected_array_values[] =
{
DoubleEq(1.1),
DoubleEq(2.2)
};
EXPECT_CALL(mock_arrayUser, doubleArrayIn(ElementsAreArray(expected_array_values)));
The signature of doubleArrayIn is
void doubleArrayIn(double array[ ]) = 0;
The error I am getting says that in gmock-matchers.h, line 2873, error "double*" is not a class, struct or union type. The error gets kicked off from line 3292 which is trying to instantiate ElementsAreArrayMatcher<T> as operator testing::Matcher<T>() const [with Container = double*, T = testing::Matcher<double>]
Any suggestions?
I am using GoogleMock 1.7.
Thanks!
Ken