OSDN Git Service

add doxycomment
authortsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 14 Sep 2003 18:59:33 +0000 (18:59 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 14 Sep 2003 18:59:33 +0000 (18:59 +0000)
14 files changed:
src/ccunit/CCUnitAssert.c
src/ccunit/CCUnitAssert.h
src/ccunit/CCUnitList.h
src/ccunit/CCUnitLogMessage.h
src/ccunit/CCUnitMakeSuite.h
src/ccunit/CCUnitTest.h
src/ccunit/CCUnitTestCase.h
src/ccunit/CCUnitTestFailure.h
src/ccunit/CCUnitTestFixture.h
src/ccunit/CCUnitTestListener.h
src/ccunit/CCUnitTestResult.h
src/ccunit/CCUnitTestRunner.h
src/ccunit/CCUnitTestSuite.h
src/ccunit/CCUnitVersion.c

index d9d62e3..f75006e 100644 (file)
@@ -49,6 +49,17 @@ void ccunit_assert (const char* file, unsigned int line,
   longjmp (_ccunit_runTest_env, (int)f);
 }
 
+/**
+ * @defgroup CCUnitValueToString ToString
+ * Make value to string.
+ * @{
+ */
+
+/**
+ * @name ccunit_assert_format_TYPE
+ * snprintf format string for each types.
+ * @{
+ */
 const char* _ccunit_assert_format_char = "%c";
 const char* _ccunit_assert_format_u_char = "%c";
 const char* _ccunit_assert_format_int = "%d";
@@ -63,7 +74,14 @@ const char* _ccunit_assert_format__ccunit_str_t = "%s";
 const char* _ccunit_assert_format__ccunit_ptr_t = "%p";
 const char* _ccunit_assert_format_quad_t = "%lld";
 const char* _ccunit_assert_format_u_quad_t = "%llu";
+/** @} */
 
+/** @name DEF_VALUE_TO_STRING
+ * Make value to string.
+ * @param TYP type of value.
+ * @param CAPACITY string size.
+ * @{
+ */
 #define DEF_VALUE_TO_STRING(TYP, CAPACITY)                     \
   static char* TYP ## _to_string (TYP value)                   \
   {                                                            \
@@ -102,6 +120,20 @@ DEF_VALUE_TO_STRING(u_quad_t, 24);
 DEF_VALUE_TO_STRING(_ccunit_str_t, 32);
 DEF_VALUE_TO_STRING(_ccunit_ptr_t, 24);
 
+/** @}
+ * end of DEF_VALUE_TO_STRING
+ */
+
+/** @}
+ * end of CCUnitValueToString
+ */
+
+/**
+ * @name AssertTest
+ * @{
+ * Assert test function.
+ * @param TYP type of test value.
+ */
 #define DEF_CCUNIT_ASSERT_TEST_TYPE(TYP)                               \
   void ccunit_assert_test_ ## TYP (const char* file,                   \
                                   unsigned int line,                   \
@@ -141,3 +173,5 @@ DEF_CCUNIT_ASSERT_TEST_TYPE(_ccunit_str_t);
 DEF_CCUNIT_ASSERT_TEST_TYPE(_ccunit_ptr_t);
 
 /** @} */
+
+/** @} */
index 270e289..bb507ea 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitAssert Assert
  *
  * A set of assert functions and macros.  Messages are only displayed
@@ -42,6 +43,7 @@
  */
 
 /**
+ * @ingroup Assertions 
  * Asserts that a condition is true. If it isn't it longjmp with
  * _ccunit_runTest_env.
  *
 extern void ccunit_assert (const char* file, unsigned int line,
                           bool condition, const char* condstr);
 
+#ifndef HAVE_U_CHAR
+typedef unsigned char u_char;                  /**< u_char */
+#endif
+#ifndef HAVE_U_INT
+typedef unsigned int u_int;                    /**< u_int */
+#endif
+#ifndef HAVE_U_SHORT
+typedef unsigned short u_short;                        /**< u_short */
+#endif
+#ifndef HAVE_U_LONG
+typedef unsigned long u_long;                  /**< u_long */
+#endif
+
+typedef const char* _ccunit_str_t;             /**< string type */
+typedef const void* _ccunit_ptr_t;             /**< pointer type */
+
 /**
+ * @name DCL_CCUNIT_ASSERT_TEST_TYPE
+ * @{
+ * @ingroup Assertions 
  * Asserts that a condition is true. If it isn't it longjmp with
  * _ccunit_runTest_env.
  *
@@ -86,7 +107,10 @@ DCL_CCUNIT_ASSERT_TEST_TYPE(quad_t);
 DCL_CCUNIT_ASSERT_TEST_TYPE(u_quad_t);
 #endif
 
+/** @} */
+
 /**
+ * @ingroup Assertions 
  * Asserts that a condition is true. If it isn't it longjmp with
  * _ccunit_runTest_env.
  *
@@ -97,6 +121,7 @@ DCL_CCUNIT_ASSERT_TEST_TYPE(u_quad_t);
 
 /** @name Assert Macros
  * The assert test macros.
+ * @ingroup Assertions 
  * @{
  */
 /**
@@ -113,9 +138,8 @@ DCL_CCUNIT_ASSERT_TEST_TYPE(u_quad_t);
   do {                                                                 \
     const TYP ex = EXPECT;                                             \
     const TYP ac = ACTUAL;                                             \
-    _CCUNIT_CONCAT(ccunit_assert_test_,TYP) (__FILE__, __LINE__, ex OP ac, \
-                                            (#EXPECT " " #OP " " #ACTUAL), \
-                                            ex, ac);                   \
+    ccunit_assert_test_ ## TYP (__FILE__, __LINE__, ex OP ac,          \
+                               (#EXPECT " " #OP " " #ACTUAL), ex, ac); \
   } while (0)
 
 #define CCUNIT_ASSERT_TEST_INT(EXPECT, OP, ACTUAL)             \
@@ -143,20 +167,21 @@ DCL_CCUNIT_ASSERT_TEST_TYPE(u_quad_t);
   CCUNIT_ASSERT_TEST (u_quad_t, EXPECT, OP, ACTUAL)
 #endif
 #define CCUNIT_ASSERT_TEST_PTR(EXPECT, OP, ACTUAL)             \
-  CCUNIT_ASSERT_TEST (ccunit_ptr_t, EXPECT, OP, ACTUAL)
+  CCUNIT_ASSERT_TEST (_ccunit_ptr_t, EXPECT, OP, ACTUAL)
 
 #define CCUNIT_ASSERT_TEST_STR(EXPECT, OP, ACTUAL)                     \
   do {                                                                 \
-    const ccunit_str_t ex = EXPECT;                                    \
-    const ccunit_str_t ac = ACTUAL;                                    \
-    const ccunit_str_t condstr = "strcmp (" #EXPECT ", " #ACTUAL ") " #OP " 0"; \
-    ccunit_assert_test_ccunti_str_t (__FILE__, __LINE__,               \
-                                    strcmp(ex, ac) OP 0, condstr, ex, ac); \
+    _ccunit_str_t ex = EXPECT;                                         \
+    _ccunit_str_t ac = ACTUAL;                                         \
+    const char* condstr = "strcmp (" #EXPECT ", " #ACTUAL ") " #OP " 0"; \
+    ccunit_assert_test__ccunit_str_t (__FILE__, __LINE__,              \
+                                     strcmp(ex, ac) OP 0, condstr, ex, ac); \
   } while (0)
 /** @} */
 
 /** @name Assert Condition Macros
  * The assert condition macros.
+ * @ingroup Assertions 
  * @{
  */
 #define CCUNIT_ASSERT_NULL(ACTUAL)             \
index b9b1aaa..2c345f0 100755 (executable)
@@ -36,6 +36,7 @@
 #endif
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitList List
  * Linked list container.
  * @{
index 055bd15..74485b4 100644 (file)
@@ -31,6 +31,7 @@
 #include <ccunit/CCUnitConfig.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitLogMessage LogMessage
  * Output messages.
  * @{
index bd0fb18..a1ccf04 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdio.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitMakeSuite MakeSuite
  * Generate test suite making code from test source code.
  * @{
@@ -162,7 +163,8 @@ extern void ccunit_writeSuite (FILE* ofp,
 /** @} */
 
 /**
- * generate test suite making function code.
+ * Generate test suite making function code.
+ * @ingroup CreatingTestSuite
  * @param ac arg count.
  * @param av array of arg string.
  * @return 0 if succeeded, else error occured.
@@ -170,10 +172,12 @@ extern void ccunit_writeSuite (FILE* ofp,
 extern int ccunit_makeSuite (int ac, char** av);
 
 /**
- * generate test suite making function code.
+ * Generate test suite making function code.
+ * @ingroup CreatingTestSuite
  * @param prg program name
  * @param ... arguments. The last arg must be NULL.
  * @return 0 if succeeded, else error occured.
+ * @see ccunit_makeSuite
  */
 extern int ccunit_va_makeSuite (const char* prg, ...);
 
index 84325a8..6d9d392 100755 (executable)
 #include <ccunit/CCUnitConfig.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitTest Test
  * Test interface module.
  * @{
  */
 
-
 /**
  * Test class type.
+ * @ingroup BrowsingCollectedTestResult
  */
 typedef enum CCUnitTestType_t {
   ccunitTypeTest,                              /**< Test class */
@@ -54,23 +55,27 @@ struct CCUnitTestResult;
 
 /**
  * run Test and collect its results.
+ * @ingroup BrowsingCollectedTestResult
  *
  * @see CCUnitTestResult
  */
 typedef struct CCUnitTest CCUnitTest;
 
 /**
+ * @ingroup BrowsingCollectedTestResult
  * run test function pointer type.
  */
 typedef void (*ccunit_runtest_func_t) (CCUnitTest* test,
                                       struct CCUnitTestResult* result);
 
 /**
+ * @ingroup BrowsingCollectedTestResult
  * test destructor function pointer type.
  */
 typedef void (*ccunit_testdtor_t) (CCUnitTest* dt);
 
 /**
+ * @ingroup BrowsingCollectedTestResult
  * Run Test and collect its results.
  *
  * @see CCUnitTestResult
@@ -83,6 +88,7 @@ struct CCUnitTest
 };
 
 /**
+ * @ingroup BrowsingCollectedTestResult
  * Initialize Test class.
  * @param test test object to initialize.
  * @param type test type.
@@ -96,6 +102,7 @@ extern CCUnitTest* ccunit_initTest (CCUnitTest* test,
                                    ccunit_testdtor_t dtor);
 
 /**
+ * @ingroup BrowsingCollectedTestResult
  * Test class destructor.
  * @param test test object to delete.
  */
index 986946f..971999b 100755 (executable)
@@ -42,6 +42,7 @@
 
 /**
  * A single test object.
+ * @ingroup WritingTestFixture
  */
 typedef struct CCUnitTestCase
 {
@@ -51,7 +52,8 @@ typedef struct CCUnitTestCase
 } CCUnitTestCase;
 
 /**
- * create new test case.
+ * Create new test case.
+ * @ingroup WritingTestFixture
  * @param name case name.
  * @param desc case description.
  * @param runTest run test function.
@@ -62,7 +64,8 @@ extern CCUnitTestCase* ccunit_newTestCase (const char* name,
                                           void (*runTest)());
 
 /**
- * delete test case.
+ * Delete test case.
+ * @ingroup WritingTestFixture
  * @param testCase deleting case.
  */
 extern void ccunit_deleteTestCase (CCUnitTestCase* testCase);
index b3abf2e..5db8cea 100644 (file)
@@ -31,6 +31,7 @@
 #include <ccunit/CCUnitConfig.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitTestFailure TestFailure
  *
  * Collects a failed test together with the failed assertion.
 
 /**
  * Collects a failed test together with the failed assertion.
+ * @ingroup BrowsingCollectedTestResult
  * @see TestResult
  */
 typedef struct CCUnitTestFailure CCUnitTestFailure;
 
 /**
  * Collects a failed test together with the failed assertion.
+ * @ingroup BrowsingCollectedTestResult
  * @see TestResult
  */
 struct CCUnitTestFailure
@@ -59,7 +62,8 @@ struct CCUnitTestFailure
 };
 
 /**
- * create new test failure.
+ * Create new test failure.
+ * @ingroup BrowsingCollectedTestResult
  *
  * @param file file name cause failure.
  * @param line line number cause failure.
@@ -75,7 +79,8 @@ extern CCUnitTestFailure* ccunit_newTestFailure (const char* file,
                                                 const char* actual);
 
 /**
- * delete test failure object.
+ * Delete test failure object.
+ * @ingroup BrowsingCollectedTestResult
  *
  * @param failure failure object.
  */
index 937bff8..44c21b3 100644 (file)
 /**
  * @ingroup CCUnitTest
  * @defgroup CCUnitTestFixture TestFixture
+ * A test fixture defines the fixture to run multiple tests.
  *
+ * @{
+ */
+
+/**
  * Wraps a test case with setUp and tearDown methods.
  *
+ * @ingroup WritingTestFixture
+ *
  * A TestCase is used to provide a common environment for a set
  * of test cases.
  *
  * in src/tools/ccunit_makeSuite.c.
  *
  * @see CCUnitTestResult, CCUnitTestSuite, CCUnitMakeSuite,
- * @{
- */
-
-/**
- * A test fixture defines the fixture to run multiple tests.
- *
- * @see CCUnitTestResult, CCUnitTestSuite, CCUnitMakeSuite.
  */
 typedef struct CCUnitTestFixture
 {
@@ -134,6 +134,7 @@ typedef struct CCUnitTestFixture
 
 /**
  * create new test fixture.
+ * @ingroup WritingTestFixture
  *
  * @param name test fixture name.
  * @param setUp test fixture setUp function.
@@ -155,6 +156,7 @@ extern inline void ccunit_addTestCase (CCUnitTestFixture* fixture,
 
 /**
  * add new test case to test fixture.
+ * @ingroup WritingTestFixture
  *
  * @param fixture test fixture.
  * @param name test case name.
index 32dbb56..4e4d18d 100644 (file)
@@ -33,6 +33,7 @@
 #include <ccunit/CCUnitTestFixture.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitTestListener TestListener
  * A Listener for test progress.
  *
@@ -50,11 +51,20 @@ struct CCUnitTestListener;
 
 /**
  * A Listener for test progress.
+ * @ingroup TrackingTestExecution
+ *
+ * Implementing the Observer pattern a CCUnitTestListener may be
+ * registered to a CCUnitTestResult to obtain information on the
+ * testing progress. Use specialized sub classes of CCUnitTestListener
+ * for text output.
+ *
+ * @see CCUnitTestResult
  */
 typedef struct CCUnitTestListener CCUnitTestListener;
 
 /**
  * A Listener for test progress.
+ * @ingroup TrackingTestExecution
  */
 struct CCUnitTestListener
 {
index b5a80f5..3418cc9 100644 (file)
@@ -34,6 +34,7 @@
 #include <ccunit/CCUnitTestCase.h>
 
 /**
+ * @ingroup ModuleHierarchy
  * @defgroup CCUnitTestResult TestResult
  * Collects the results of a test case module.
  *
  */
 
 /**
- * collects the results of a test case.
+ * Collects the results of a test case.
+ * @ingroup TrackingTestExecution
+ *
+ * This module use a CCUnitTestListener to be informed of the ongoing
+ * tests.
  *
  * @see CCUnitTest, CCUnitTestListener.
  */
@@ -60,18 +65,21 @@ typedef struct CCUnitTestResult
 
 /**
  * Construct TestResult
+ * @ingroup TrackingTestExecution
  */
 extern CCUnitTestResult* ccunit_newTestResult ();
 
 /**
  * Destruct TestResult
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern void ccunit_deleteTestResult (CCUnitTestResult* result);
 
 /**
- * Adds a failure to the list of failures. The passed in failed
- * assertion caused the failure.
+ * Adds a failure to the list of failures.
+ * @ingroup TrackingTestExecution
+ * The passed in failed assertion caused the failure.
  * @param result result object.
  * @param failure failure.
  */
@@ -80,6 +88,7 @@ extern void ccunit_addFailure (CCUnitTestResult* result,
 
 /**
  * Registers a TestRunner as TestListener.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  * @param listener adding listener.
  */
@@ -88,30 +97,35 @@ extern inline void ccunit_addResultListener (CCUnitTestResult* result,
 
 /**
  * Returns an Iterator for the failures.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern inline CCUnitListIterator* ccunit_failures(CCUnitTestResult* result);
 
 /**
  * Gets the number of detected failures.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern inline size_t ccunit_failureCount (CCUnitTestResult* result);
 
 /**
  * Returns whether the entire test was successful or not.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern inline bool ccunit_wasSuccessful (CCUnitTestResult* result);
 
 /**
  * Marks that the test run should stop.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern inline void ccunit_stopTest (CCUnitTestResult* result);
 
 /**
  * Gets the number of run tests.
+ * @ingroup TrackingTestExecution
  * @param result result object.
  */
 extern inline size_t ccunit_runCount (CCUnitTestResult* result);
index b02833d..a04bc57 100644 (file)
 /**
  * @ingroup CCUnitTestListener
  * @defgroup CCUnitTestRunner TestRunner
+ * Runs a single test and collects its results.  This method can be
+ * used to start a test run from your program.
+ * @{
+ */
+
+/**
+ * @ingroup ExecutingTest
  * A command line based tool to run tests.  Runs a single test and
  * collects its results.  This method can be used to start a test run
  * from your program.
  *       return runner->run (runner, suite);
  *     }
  * </pre>
- * @{
- */
-
-/**
- * Runs a single test and collects its results.  This method can be
- * used to start a test run from your program.
  *
  * @see CCUnitTestSuite, CCUnitTestCase.
  */
@@ -73,6 +74,7 @@ struct CCUnitTestRunner
 };
 
 /**
+ * @ingroup ExecutingTest
  * constructor.
  * @param output prints test result into this stream.
  * @return new CCUnitTestRunner object.
@@ -80,6 +82,7 @@ struct CCUnitTestRunner
 extern CCUnitTestRunner* ccunit_newTestRunner (FILE* output);
 
 /**
+ * @ingroup ExecutingTest
  * destructor.
  * @param runner TestRunner object to destruct.
  */
index 6874e4a..259aea4 100755 (executable)
@@ -1,4 +1,4 @@
-/* -*- mode: C; -*- */
+/* -*- C -*- */
 /* Copyright (C) 2003 TSUTSUMI Kikuo.
    This file is part of the CCUnit Library.
 
  * @defgroup CCUnitTestSuite TestSuite
  *
  * A <code>Composite</code> class of Tests.
+ * It runs a collection of test cases.
+ * @{
+ */
+
+/**
+ * A <code>Composite</code> class of Tests.
+ * @ingroup CreatingTestSuite
  * It runs a collection of test cases. Here is an example.
  * <pre>
  *     CCUnitTestSuite* suite = ccunit_newTestSuite ();
  *     ccunit_addTestCase (suite, <var>TESTCASE_1</var>);
  *     ccunit_addTestCase (suite, <var>TESTCASE_2</var>);
  * </pre>
- * @{
- */
-
-/**
- * A <code>Composite</code> class of Tests.
- * It runs a collection of test cases.
  * @see CCUnitTest, CCUnitTestCase.
  */
 typedef struct CCUnitTestSuite
@@ -60,6 +61,7 @@ typedef struct CCUnitTestSuite
 
 /**
  * Constructs an empty TestSuite.
+ * @ingroup CreatingTestSuite
  * @param name test suite name.
  * @return new test suite.
  */
@@ -67,12 +69,14 @@ extern inline CCUnitTestSuite* ccunit_newTestSuite(const char* name);
 
 /**
  * Destructs test suite.
+ * @ingroup CreatingTestSuite
  * @param suite deleting suite.
  */
 extern inline void ccunit_deleteTestSuite (CCUnitTestSuite* suite);
 
 /**
  * Adds a test to the suite.
+ * @ingroup CreatingTestSuite
  * @param suite test suite.
  * @param test test to add.
  */
@@ -80,6 +84,7 @@ extern inline void ccunit_addTest (CCUnitTestSuite* suite, CCUnitTest* test);
 
 /**
  * Adds a test suite to the suite.
+ * @ingroup CreatingTestSuite
  * @param suite test suite.
  * @param testSuite test to add.
  */
@@ -88,6 +93,7 @@ extern inline void ccunit_addTestSuite (CCUnitTestSuite* suite,
 
 /**
  * Adds a test fixture to the suite.
+ * @ingroup CreatingTestSuite
  * @param suite test suite.
  * @param fixture test to add.
  */
@@ -96,6 +102,7 @@ extern inline void ccunit_addTestFixture (CCUnitTestSuite* suite,
 
 /**
  * Create a test suite from test source file.
+ * @ingroup CreatingTestSuite
  * @param name test suite name.
  * @return new test suite.
  */
index 47c763e..0cf4304 100644 (file)
  */
 #include <ccunit/CCUnitConfig.h>
 
-/** @defgroup CCUnitVersion Version
+/**
+ * @defgroup CCUnitVersion Version
  * ccunit library version string definitions.
+ * @ingroup ModuleHierarchy
  * @{
  */
-/** package name */
+/**
+ * package name
+ * @ingroup ModuleHierarchy
+ */
 const char* const _ccunit_package_name = PACKAGE_NAME;
 
-/** package version */
+/**
+ * package version
+ * @ingroup ModuleHierarchy
+ */
 const char* const _ccunit_package_version = PACKAGE_VERSION;
 
 /** @} */