QT的TEST宏实现机制

    技术2024-06-13  68

    TEST(x, y)

    {

    //....

    }

     

    #define TEST(x, y) GTEST_TEST(x, y)

     

    #define GTEST_TEST(x, y)/   GTEST_TEST_(x, y, /               ::testing::Test, ::testing::internal::GetTestTypeId()) #define GTEST_TEST_(x, y, ::testing::Test, ::testing::internal::GetTestTypeId())/ class x_yTest(x, y) : public ::testing::Test {  public:   x_yTest(x, y)() {}  private:   virtual void TestBody();   static ::testing::TestInfo* const test_info_;   x_yTest(x_yTest const &);   void operator=(x_yTest const &) }; ::testing::TestInfo* const x_yTest(x, y)::test_info_ = ::testing::internal::MakeAndRegisterTestInfo(/         x, y, "", "",          (::testing::internal::GetTestTypeId()),          ::testing::Test::SetUpTestCase,          ::testing::Test::TearDownTestCase,          new ::testing::internal::TestFactoryImpl<x_yTest(x, y)>); void x_yTest(x, y)::TestBody() { //.... }

    最新回复(0)