lundi 12 septembre 2016

how to Analysis the code in a C++ head file?

I need to write a program to analysis the code in a C/c++ head file. the input is a head file,like:head.h ; I want to recognize class names and function names ,so I can Generating unit test of google test。 like:

    TEST(UnitTest,test)
    {

    unsigned char * image_src = NULL;

    unsigned char * image_dst = NULL;

    int image_width = ?;

    int image_height = ?;

    color_convert color_convert_type = ?;

    EXPECT_EQ(ErrorCode_t, face_color_convert(const unsigned char *, unsigned char *, int, int, color_convert));



  }
  int main(int argc,char**argv)
  {
    ::testing::InitGoogleTest(&argc,argv);
    return RUN_ALL_TESTS();
  }

face_color_convert is a function name,and ErroCode_t is return value type.

Aucun commentaire:

Enregistrer un commentaire