OSDN Git Service

A TestFunc class is defined as the alias of TestCase.
authortsntsumi <tsntsumi@users.sourceforge.jp>
Wed, 1 Oct 2003 20:47:28 +0000 (20:47 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Wed, 1 Oct 2003 20:47:28 +0000 (20:47 +0000)
A function related to TestFunc is added.

src/ccunit/CCUnitTestCase.h

index 15c179a..ee7f803 100755 (executable)
@@ -75,6 +75,8 @@ typedef struct CCUnitTestCase
   void (*runTest) ();                          /**< run test function */
 } CCUnitTestCase;
 
+typedef CCUnitTestCase CCUnitTestFunc;
+
 /**
  * Create new test case.
  * @param name case name.
@@ -88,12 +90,32 @@ extern CCUnitTestCase* ccunit_newTestCase (const char* name,
                                           void (*runTest)());
 
 /**
+ * Create new test function.
+ * @param name func name.
+ * @param desc func description.
+ * @param func run test function.
+ * @return new test func.
+ * @ingroup WritingTestFixture
+ */
+extern inline CCUnitTestFunc* ccunit_newTestFunc (const char* name,
+                                                 const char* desc,
+                                                 void (*func)());
+#define CCUNIT_NEWTESTFUNC(FUNC) ccunit_newTestFunc (#FUNC, NULL, FUNC)
+
+/**
  * Delete test case.
  * @param testCase deleting case.
  * @ingroup WritingTestFixture
  */
 extern void ccunit_deleteTestCase (CCUnitTestCase* testCase);
 
+/**
+ * Delete test func.
+ * @param testFunc deleting func.
+ * @ingroup WritingTestFixture
+ */
+extern inline void ccunit_deleteTestFunc (CCUnitTestFunc* testFunc);
+
 /** @} */
 
 #endif /* !CCUNITTESTCASE_H */