OSDN Git Service

change struct name
authortsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 28 Sep 2003 13:52:44 +0000 (13:52 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 28 Sep 2003 13:52:44 +0000 (13:52 +0000)
src/ccunit/CCUnitMakeSuite.h
src/ccunit/CCUnitWriteSuite.c

index 4d7a9a7..3c20f1b 100644 (file)
@@ -75,6 +75,7 @@ typedef struct CCUnitTestDef
 {
   CCUnitTestType_t type;                       /**< test type */
   char* name;                                  /**< test name */
+  char* idname;                                        /**< id name */
   void (*dtor) (struct CCUnitTestDef*);                /**< test destcuctor  */
 } CCUnitTestDef;
 
@@ -121,12 +122,13 @@ extern inline void ccunit_deleteTestSuiteDef (CCUnitTestSuiteDef* suite);
 /*
  * Test case definition information.
  */
-typedef struct CCUnitTestCaseDef
+typedef struct CCUnitFuncDef
 {
+  char* scope;                                 /**< scope */
   char* type;                                  /**< return type */
   char* name;                                  /**< function name */
   char* desc;                                  /**< description */
-} CCUnitTestCaseDef;
+} CCUnitFuncDef;
 
 /* @} */
 
@@ -142,9 +144,11 @@ typedef struct CCUnitTestCaseDef
 typedef struct CCUnitTestFixtureDef
 {
   CCUnitTestDef testdef;                       /**< super class */
+  CCUnitFuncDef* ctor;                         /**< constructor */
+  CCUnitFuncDef* dtor;                         /**< destructor */
+  CCUnitFuncDef* setUp;                                /**< test setup function */
+  CCUnitFuncDef* tearDown;                     /**< test tearDown function */
   CCUnitList testCases;                                /**< test case list */
-  CCUnitTestCaseDef* setUp;                    /**< test setup function */
-  CCUnitTestCaseDef* tearDown;                 /**< test tearDown function */
 } CCUnitTestFixtureDef;
 
 /* @} */
@@ -182,6 +186,17 @@ extern void ccunit_writeSuite (FILE* ofp,
                               const char* name,
                               CCUnitTestSuiteDef* suite);
 
+/*
+ * output test suite making function code.
+ *
+ * @param ofp output stream.
+ * @param name add function name.
+ * @param suite test suite to print.
+ */
+extern void ccunit_printSuite (FILE* ofp,
+                              const char* name,
+                              CCUnitTestSuiteDef* suite);
+
 /* @} */
 
 /**
index 59084e4..ee9c931 100644 (file)
@@ -42,7 +42,7 @@ static void printPrototypes (FILE* ofp, CCUnitTestSuiteDef* suite)
 {
   CCUnitListIterator itor;
   CCUnitTestDef* test;
-  CCUnitTestCaseDef* testCase;
+  CCUnitFuncDef* testCase;
   static unsigned suiteid = 0;
   char sname[32];
   sprintf (sname, "newSuite_%03u", ++ suiteid);
@@ -141,7 +141,7 @@ static void printSuite (FILE* ofp,
       else if (testdef->type == ccunitTypeFixture)
        {
          CCUnitListIterator fitor;
-         CCUnitTestCaseDef* testCase;
+         CCUnitFuncDef* testCase;
          CCUnitTestFixtureDef* testFixture = (CCUnitTestFixtureDef*)testdef;
          fprintf (ofp,
                   "  {\n"