我试图了解 Google 测试装置是如何工作的。
假设我有以下代码:
class PhraseTest : public ::testing::Test
{
protected:
virtual void SetUp()
{
phraseClass * myPhrase1 = new createPhrase("1234567890");
phraseClass * myPhrase2 = new createPhrase("1234567890");
}
virtual void TearDown()
{
delete *myPhrase1;
delete *myPhrase2;
}
};
TEST_F(PhraseTest, OperatorTest)
{
ASSERT_TRUE(*myPhrase1 == *myPhrase2);
}
当我编译时,为什么它说myPhrase1
并且myPhrase2
未在TEST_F
?