Pregunta

I'm trying to get a working googletest test that compares two vectors. For this I'm using google mock with its matchers but I get a C3861 error saying "ContainerEq identifier not found" and also C2512 saying "testing::AssertionResult has not a proper default constructor available". Why?

TEST(MyTestSuite, MyTest)
{
    std::vector<int> test1;
    std::vector<int> test2;

    ...

    EXPECT_THAT(test1, ContainerEq(test2));
}
¿Fue útil?

Solución

You're just missing gtest's testing namespace qualifier:

EXPECT_THAT(test1, ::testing::ContainerEq(test2));
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top