I have union as
using my_union = union my_union {
struct {
int var1;
int var2;
};
long
var;
bool operator == (const my_union & oth) {
return var == oth.var;
}
};
using my_union_1d = std::array < my_union, 2 > ;
using my_union_2d = std::array < my_union_1d, 3 > ;
I have some function which accept this array
class test {
public:
void Foo(my_union_2d & arg1);
};
Now I need to check if Mocked-Foo is called with my expected arguments
class TestMock: Public Test {
public: MOCK_METHOD(void, Foo, (my_union_2d & ));
};
my_union_2d expected_args;
EXPECT_CALL( * (TestMock * ) obj, Foo(expected_args)).Times(1):
However code doesn't compile, as the array of array == operator is not found. I tried changing of AllOfArray, but I seem lost in the documentation for GTest. Does anyone know what needs to be done or a Reference point?
Proper
operator==
that is a member function shall be aconst
method: