2012-09-09 15 views
8

Sto cercando di ottenere un test googletest funzionante che confronti due vettori. Per questo sto usando google mock con il suo matchers ma ottengo un errore C3861 che dice "identificatore ContainerEq non trovato" e anche C2512 che dice "test :: AssertionResult non ha un costruttore predefinito appropriato disponibile". Perché?Confronta i contenitori con GoogleTest

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

    ... 

    EXPECT_THAT(test1, ContainerEq(test2)); 
} 

risposta

16

Stai solo manca di qualificazione testing namespace di GTEST:

EXPECT_THAT(test1, ::testing::ContainerEq(test2)); 
+0

non la pensano a questo proposito, grazie! – Stefano