OSDN Git Service

add new
[ccunit/ccunit.git] / doc / cookbook.dox
index 77f74cc..cf0c172 100644 (file)
@@ -61,272 +61,539 @@ To make a simple test, here is what you do:
 @~
 
 <ol>
-<li> @~english Create a test function
-     @~japanese ¥Æ¥¹¥È´Ø¿ô¤òºî¤ë
-     @~
+<li> @english Create a test function
+     @japanese ¥Æ¥¹¥È´Ø¿ô¤òºî¤ê¤Þ¤¹¡£
+     @endif
 </li>
-<li> @~english When you want to check a value, call
-     @~japanese Ãͤò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢@~
+<li> @english When you want to check a value, call
      @link CCUNIT_ASSERT() CCUNIT_ASSERT(bool) @endlink
-     @~english and pass a bool that is true if the test succeeds
-     @~japanese ¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢
-     ¤â¤·¥Æ¥¹¥È¤¬À®¸ù¤¹¤ë¤Ê¤é¿¿¤òÊÖ¤¹¤è¤¦¤Ê¿¿µ¶ÃͤòÅϤ·¤Þ¤¹@~
+     and pass a bool that is true if the test succeeds
 
-     @~english ASSERT macro is listed in others as well in
+     ASSERT macro is listed in others as well in
      @link Assertions Making assertions @endlink.
-     @~japanese ASSERT ´Ø·¸¤Î¥Þ¥¯¥í¤Ï¾¤Ë¤â
-     @link Assertions Making assertions @endlink
+     @japanese
+     Ãͤò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢
+     @link CCUNIT_ASSERT() CCUNIT_ASSERT(bool) @endlink
+     ¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢
+     ¥Æ¥¹¥È¤¬À®¸ù¤¹¤ë¤Ê¤é¿¿¤òÊÖ¤¹¤è¤¦¤Ê¿¿µ¶ÃͤòÅϤ·¤Þ¤¹¡£
+
+     ASSERT ´Ø·¸¤Î¥Þ¥¯¥í¤Ï¾¤Ë¤â
+     @link Assertions ¥¢¥µ¡¼¥È¤ÎÀë¸À @endlink
      ¤Ë¥ê¥¹¥È¤·¤Æ¤¢¤ê¤Þ¤¹¡£
-     @~
+     @endif
 </li>
 </ol>
 
 @~english
 For example, to test that the sum of two complex number
 which is the sum of the values of two complex numbers,
-write:
+write (This sample program is in the @c examples/complex directory):
 @~japanese
-Î㤨¤Ð¡¢Æó¤Ä¤ÎÊ£ÁÇ¿ô¤Î¹ç·×¤¬¡¢
-Æó¤Ä¤ÎÊ£ÁÇ¿ô¤ÎÃͤò²Ã»»¤·¤¿ÃͤÈƱ¤¸¤Ç¤¢¤ë¤³¤È¤ò¥Æ¥¹¥È¤¹¤ë¤È¤·¤Þ¤¹¡£
-¡Ê¤³¤³¤Ç»ÈÍѤ¹¤ë¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï
+Î㤨¤Ð¡¢´Êñ¤ÊÊ£ÁÇ¿ô¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Æ¥¹¥È¤¹¤ë¤³¤È¤òÎã¤Ë¤È¤Ã¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+¡Ê¤³¤³¤Ç»ÈÍѤ¹¤ë@ref sample_programs¤Ï
 examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£¡Ë
+Ê£ÁÇ¿ô¤ò½é´ü²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¤«¤ò¥Æ¥¹¥È¤·¤¿¤ê¡¢
+Æó¤Ä¤ÎÊ£ÁÇ¿ô¤¬Åù¤·¤¤¤«¤ò¥Æ¥¹¥È¤¹¤ë¤È¤·¤Þ¤¹¡£
 @~
 
-@~english
-This sample program is in the examples/complex directory.
-@~
+@dontinclude complex/testComplex.c
+
+@skip test_complex_new
+@until }
+@skip test_complex_equals
+@until }
+
+@english
+@japanese
+¤³¤ÎÆó¤Ä¤Î¥Æ¥¹¥È´Ø¿ô¤ò¤Þ¤È¤á¤Æ¤Ò¤È¤Ä¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ë¤·¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+@endif
+
+@dontinclude complex/runTestCase.c
+
+@skip CCUnitTestCase.h
+@until CCUnitTestResult.h
+
+@english
+@japanese
+ɬÍפʥإåÀ¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£
+@endif
+
+@until main
+@until ccunit_newTestCase
+
+@english
+@japanese
+¤Þ¤º¥Æ¥¹¥È¥±¡¼¥¹¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
+@endif
+
+@until test_complex_equals);
+
+@english
+@japanese
+¤½¤·¤Æ¥Æ¥¹¥È¥±¡¼¥¹¤Ë¥Æ¥¹¥È´Ø¿ô¤òÅÐÏ¿¤·¤Þ¤¹¡£
+ɽÌÀ (ASSERT) ¤¬¼ºÇÔ¤·¤¿»þ¤Ëɽ¼¨¤¹¤ë¤¿¤á¤Î´Ø¿ô̾¤È´Ø¿ô¤ÎÀâÌÀ¤ò°ì½ï¤Ë»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£
+@endif
+
+@until wasSuccessful
+
+@english
+@japanese
+¥Æ¥¹¥È¥±¡¼¥¹¤ò¼Â¹Ô¤·¡¢
+·ë²Ì¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
+@endif
+
+@until }
+
+@english
+@japanese
+³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò²òÊü¤·¡¢
+·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£
+@endif
+
+@english
+The sample code made in the above is in the directory <code>examples/complex</code>,
+the files are @c testComplex.c and <code>runTestCase.c</code>.
+@japanese
+¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢@c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î
+<code>testComplex.c, runTestCase.c</code> ¤Ë¤¢¤ê¤Þ¤¹¡£
+
+¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
 
 @code
-void test_complex_add ()
-{
-  complex_t c10_1 = { 10.0, 1.0 };
-  complex_t c1_1 = { 1.0, 1.0 };
-  complex_t result;
-  complex_t c11_2 = { 11.0, 2.0 };
-  CCUNIT_ASSERT (complex_equals (&c11_2, complex_add (&result, &c10_1, &c1_1)));
-}
+$ gcc -o runTestCase runTestCase.c testComplex.c complex.c -lccunit
+$ ./runTestCase
+$ echo $?
+0
 @endcode
 
 @~english
-That was a very simple test. Ordinarily, you'll have many
-little test cases that you'll want to run on the same set of
-objects. To do this, use a fixture.
+When the test case is run, that specific test functions
+will be run.  This is not a useful thing to do, however, as
+no diagnostics will be displayed.  One will normally use a
+@link ExecutingTest TestRunner @endlink to
+display the results.
 @~japanese
-¤³¤ì¤ÏÂçÊÑñ½ã¤Ê¥Æ¥¹¥È¤Ç¤¹¡£
-Ä̾Ʊ¤¸¥Ç¡¼¥¿¤Î¥»¥Ã¥È¤ÇÁö¤é¤»¤ë¤¿¤á¤Ë¡¢
-¤¿¤¯¤µ¤ó¤Î¾®¤µ¤Ê¥Æ¥¹¥È¥±¡¼¥¹¤òºî¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-¤½¤³¤Ç¥Õ¥£¥¯¥¹¥Á¥ã¡ÊÈ÷Éʡˤò»È¤¤¤Þ¤¹¡£
+¥Æ¥¹¥È¥±¡¼¥¹¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢
+»ØÄꤷ¤¿¥Æ¥¹¥È´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£
+¤³¤ì¤Ï¤Þ¤À¤¢¤Þ¤êÊØÍø¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¢
+¤Ê¤¼¤Ê¤é¡¢¿ÇÃǤ¬É½¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£
+Ä̾ï¤Ï @link ExecutingTest TestRunner @endlink
+¤Ç·ë²Ì¤òɽ¼¨¤·¤Þ¤¹¡£
 @~
 
 @english
-@section fixture Fixture
+@section test_runner TestRunner
 @japanese
-@section fixture ¥Õ¥£¥¯¥¹¥Á¥ã
+@section test_runner ¥Æ¥¹¥È¥é¥ó¥Ê¡¼
 @endif
 
+@english
+How do you run your tests and collect their results?
+The TestCase store result of own tests into
+the @link CCUnitTestResult TestResult @endlink.
+@japanese
+¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤¿¤È¤­¤Ë¡¢¤É¤¦¤ä¤Ã¤Æ¤½¤Î·ë²Ì¤ò½¸¤á¤¿¤éÎɤ¤¤Ç¤·¤ç¤¦¤«¡£
+¥Æ¥¹¥È¥±¡¼¥¹¤Ï¥Æ¥¹¥È´Ø¿ô¤Î¼Â¹Ô·ë²Ì
+@link CCUnitTestFailure TestFailure @endlink ¤ò
+@link CCUnitTestResult TestResult @endlink ¤Ë³ÊǼ¤·¤Þ¤¹¡£
+Ʊ»þ¤Ë¥Æ¥¹¥È¤Î¼Â¹Ô¾õ¶·¤ò @link CCUnitTestRunner TestRunner @endlink
+¤ËÄÌÃΤ·¤Þ¤¹¡£
+@endif
+
+@dot
+digraph TestResult {
+  node [ fontsize=9, fontname=Helvetica ]
+  TestRunner
+  { rank=same;
+    edge [ fontsize=9, fontname=Courier ]
+    TestCase -> TestResult [ label="TestFailure", style=dotted, arrowhead=vee ];
+  }
+  edge [ fontsize=9, dir=back ]
+  TestRunner -> TestCase [ label="Notify", fontname=Times, 
+                          style=dotted, arrowhead=vee ];
+  TestRunner -> TestResult [ arrowtail=none ];
+  TestCase -> "TestFunc 1..n";
+  TestResult -> "TestFailure 0..m" [ arrowtail=diamond ];
+}
+@enddot
+
 @~english
-What if you have two or more tests that operate on the same
-similar set of objects?
+Once you have a test suite, you'll want to run it. %CCUnit
+provides @link ExecutingTest TestRunner @endlink
+to define the suite to be run and to display
+its results.
 @~japanese
-¤â¤·Æó¤Ä°Ê¾å¤Î¥Æ¥¹¥È¤¬¤¢¤ë¤Ê¤é¡¢
-Ʊ¤¸Îà»÷¤Î¥Ç¡¼¥¿¤Î¥»¥Ã¥È¤ÇÁàºî¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
+°ì¤Ä¥Æ¥¹¥È¥±¡¼¥¹¤ò½ñ¤¤¤¿¤é¡¢
+¤½¤ì¤ò¼Â¹Ô¤·¤¿¤¤¤Ç¤·¤ç¤¦¡£
+CCUnit ¤Ï¥Æ¥¹¥È¥±¡¼¥¹¤ò¥Æ¥¹¥È¥¹¡¼¥Ä¤Ë¤Þ¤È¤á¤Æ¤ë¤³¤È¤Ç¤³¤ì¤é¤ò¼Â¹Ô¤·¡¢
+·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Î @link ExecutingTest TestRunner @endlink ¤òÄ󶡤·¤Þ¤¹¡£
 @~
 
 @~english
-Tests need to run against the background of a known set of
-objects. This set of objects is called a test fixture. When
-you are writing tests you will often find that you spend
-more time writing the code to set up the fixture than you do
-in actually testing values.
+To use the @link CCUnitTestRunner TestRunner @endlink,
+include the header files for the tests in runTestCaseRunner.c:
 @~japanese
-¥Æ¥¹¥È¤Ï¼þÃΤΥǡ¼¥¿¤Î¥»¥Ã¥È¤òÇطʤˤ·¤Æ¼Â¹Ô¤µ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¥Ç¡¼¥¿¤Î¥»¥Ã¥È¤ò¥Õ¥£¥¯¥¹¥Á¥ã¤È¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡£
-¥Æ¥¹¥È¤ò½ñ¤¤¤Æ¤¤¤ë¤È¡¢
-¼ÂºÝ¤Î¥Æ¥¹¥È¤¹¤ëÃͤò¥Õ¥£¥¯¥¹¥Á¥ã¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¥³¡¼¥É¤ò½ñ¤¯Êý¤Ë¡¢
-¤è¤ê»þ´Ö¤ò¤«¤±¤Æ¤¤¤ë¤³¤È¤Ëµ¤¤Å¤¯¤³¤È¤¬¤è¤¯¤¢¤ê¤Þ¤¹¡£
+@link CCUnitTestRunner TestRunner @endlink ¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢
+Î㤨¤Ð runTestCaseRunner.c ¤Ç¥Æ¥¹¥È¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£
 @~
 
+@dontinclude complex/runTestCaseRunner.c
+
+@skipline #include
+@until CCUnitTestRunner.h
+
+@until ccunit_addTestCase
+
+@english
+@japanese
+¤Þ¤º TestSuite ¤òºîÀ®¤·¡¢
+¤½¤ì¤Ë TestCase ¤òÅÐÏ¿¤·¤Þ¤¹¡£
+@endif
+
+@until runTestRunner
+
 @~english
-Often, you will be able to use the same fixture for several
-different tests. Each case will send slightly different
-messages or parameters to the fixture and will check for
-different results.
+And call to
+@link ccunit_runTestRunner()
+ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink
+in the <code>main()</code> function:
 @~japanese
-¿¤¯¤Î¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤Î°Û¤Ê¤Ã¤¿¥Æ¥¹¥È¤Î¤¿¤á¤ËƱ¤¸¥Õ¥£¥¯¥¹¥Á¥ã¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤½¤ì¤¾¤ì¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ï¾¯¤·°Û¤Ê¤Ã¤¿¥á¥Ã¥»¡¼¥¸¡¢
-¤¢¤ë¤¤¤Ï¥Ñ¥é¥á¡¼¥¿¤ò¥Õ¥£¥¯¥¹¥Á¥ã¤ËÁ÷¤ê¡¢
-°Û¤Ê¤ë·ë²Ì¤òÄ´¤Ù¤Þ¤¹¡£
+¤½¤·¤Æ @link ccunit_runTestRunner()
+ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink
+¤ò¼Â¹Ô¤·¤Þ¤¹¡£
 @~
 
+@until deleteTestCase
+
+@english
+@japanese
+³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£
+¤¿¤À¤·¡¢@c testCase ¤Ï @c suite ¤ËÅÐÏ¿¤·¤Æ¤¢¤ë¤Î¤Ç¡¢
+@c suite ¤ò²òÊü¤¹¤ë»þ¤Ë°ì½ï¤Ë²òÊü¤µ¤ì¤Þ¤¹¡£
+¤½¤Î¤¿¤á @c testCase ¤Ï¤³¤³¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó¡£
+²òÊü¤·¤è¤¦¤È¤¹¤ë¤È Bus error ¤Ê¤É¤Ë¤Ê¤ê¤Þ¤¹¤Î¤ÇÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+@until }
+
+@english
+The sample code made in the above is in the directory <code>examples/complex</code>,
+the files <code>testComplex.c, complexTestSuite.c</code> and <code>runTestRunner.c</code>.
+@japanese
+¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢<code>examples/complex</code> ¥Ç¥£¥ì¥¯¥È¥ê¤Î
+<code>runTestCaseRunner.c</code>
+¤Ë¤¢¤ê¤Þ¤¹¡£
+
+¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
+
+@code
+$ gcc -I. -o runTestCaseRunner runTestCaseRunner.c testComplex.c complex.c -lccunit
+$ ./runTestCaseRunner
+..
+Time: 0.000027 sec
+
+OK (2 tests)
+@endcode
+
 @~english
-When you have a common fixture, here is what you do:
+The @link ExecutingTest TestRunner @endlink will run the tests.
+If all the tests pass, you'll get an informative message.
+If any fail, you'll get the following information:
 @~japanese
-¤â¤·¶¦Ä̤¹¤ë¥Õ¥£¥¯¥¹¥Á¥ã¤¬¤¢¤ì¤Ð¡¢¤³¤ó¤Ê¤Õ¤¦¤Ë¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
+@link ExecutingTest TestRunner @endlink ¤Ï¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
+¤â¤·¤¹¤Ù¤Æ¤Î¥Æ¥¹¥È¤¬¥Ñ¥¹¤¹¤ì¤Ð¡¢¤½¤Î¾ðÊó¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+¾å¤ÎÎã¤Ç¤Ï¡¢ºÇ½é¤Î¡Ö<code>..</code>¡×¤Ï¼Â¹Ô¤·¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Ç¤¹¡£
+¼Â¹Ô¤¹¤ëľÁ°¤Ë¡Ö<code>.</code>¡×¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£
+Á´¤Æ¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Î¼Â¹Ô¤¬½ªÎ»¤¹¤ë¤È¡¢
+¼Â¹Ô¤Ë¤«¤«¤Ã¤¿»þ´Ö¤È¼Â¹Ô¤·¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Î¿ô¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+
+¤É¤ì¤«¤¬¼ºÇÔ¤¹¤ì¤Ð¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ê¾ðÊó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
 @~
 
-<ol>
-<li>@~english
-    Create a @link CCUnitTestCase TestCase @endlink object
-    @~japanese
-    @link CCUnitTestCase TestCase @endlink ¹½Â¤ÂΤ˥á¥â¥ê¤ò³ä¤êÅö¤Æ¤Þ¤¹
-    ¡Ê°Ê¹ß¡¢¹½Â¤ÂΤ˳ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò¡¢¥ª¥Ö¥¸¥§¥¯¥È¤È¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡Ë
-    @~
-</li>
-<li>@~english
-    Add an global variable for each part of the fixture
-    @~japanese
-    ¥Õ¥£¥¯¥¹¥Á¥ã¤Î¤½¤ì¤¾¤ì¤ÎÉôʬ¤ËÂç°èÊÑ¿ô¤òÄɲä·¤Þ¤¹
-    @~
-</li>
+<ul>
 <li>@~english
-    Write <code>setUp()</code> function to initialize the valiables
+    The name of the source file that contains the test
     @~japanese
-    <code>setUp()</code> ´Ø¿ô¤ò½ñ¤¤¤ÆÊÑ¿ô¤ò½é´ü²½¤·¤Þ¤¹
+    ¥Æ¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾
     @~
 </li>
 <li>@~english
-    Write <code>tearDown()</code> to release any permanent
-    resources you allocated in <code>setUp</code>
+    The line number where the failure occurred
     @~japanese
-    <code>tearDown()</code> ´Ø¿ô¤ò½ñ¤¤¤Æ<code>setUp</code>
-    ¤Ç³ä¤êÅö¤Æ¤¿±Ê³Ū¥ê¥½¡¼¥¹¤ò²òÊü¤·¤Þ¤¹
+    ¼ºÇÔ¤¬µ¯¤³¤Ã¤¿¹ÔÈÖ¹æ
     @~
 </li>
 <li>@~english
-    Create a @link CCUnitTestFixture TestFixture @endlink object
+    The name of the test case that failed
     @~japanese
-    @link CCUnitTestFixture CCUnitTestFixture @endlink
-    ¹½Â¤ÂΤ˥á¥â¥ê¤ò³ä¤êÅö¤Æ¤Þ¤¹
+    ¼ºÇÔ¤·¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Î̾Á°
     @~
 </li>
 <li>@~english
-    Add @link CCUnitTestCase TestCase @endlink objects to fixture object
+    All of the text inside the call to
+    <code>CCUNIT_ASSERT ()</code> which detected the failure
     @~japanese
-    @link CCUnitTestCase TestCase @endlink ¥ª¥Ö¥¸¥§¥¯¥È¤ò
-    @link CCUnitTestFixture TestFixture @endlink
-    ¥Õ¥£¥¯¥¹¥Á¥ã¥ª¥Ö¥¸¥§¥¯¥È¤ËÅÐÏ¿¤·¤Þ¤¹¡£
+    ¼ºÇÔ¤ò¸¡ÃΤ·¤¿<code>CCUNIT_ASSERT ()</code>¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Î¾ò·ï¤Îʸ»úÎó¡£
     @~
 </li>
-</ol>
+</ul>
 
-@~english
-For example, to write several test cases, first create a
-fixture:
-@~japanese
-Î㤨¤Ð¡¢¤¤¤¯¤Ä¤«¤Î¥Æ¥¹¥È¥±¡¼¥¹¤ò½ñ¤¯¾ì¹ç¡¢
-ºÇ½é¤Ë¥Õ¥£¥¯¥¹¥Á¥ã¤òºîÀ®¤·¤Þ¤¹¡£
-@~
+@english
+@japanese
+»î¤·¤Ë @c testComplex.c ¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ç¤ï¤¶¤È´Ö°ã¤¨¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+@endif
 
 @code
-//** TEST CASE: complex number test *\/
-
-#include "complex.h"
-
-static complex_t* s10_1;
-static complex_t* s1_1;
-static complex_t* s11_2;
-
-void setUp_complex_test ()
-{
-  s10_1 = complex_new (10, 1);
-  s1_1 = complex_new (1, 1);
-  s11_2 = complex_new (11, 2);
-}
-
-void tearDown_complex_test ()
+void test_complex_equals ()
 {
-  complex_delete (s10_1);
-  complex_delete (s1_1);
-  complex_delete (s11_2);
+  ...
+  CCUNIT_ASSERT (complex_equals (c10_1, c10_1_2));
+/*CCUNIT_ASSERT (complex_equals (c10_1, c1_1) == 0);*/
+  CCUNIT_ASSERT (complex_equals (c10_1, c1_1) != 0);
+  ...
 }
+@endcode
 
-...
-
-  CCUnitTestFixture* fixture;
-  fixture = ccunit_newTestFixture ("complex test",
-                                   CCUNIT_NEWTESTFUNC(setUp_complex_test),
-                                   CCUNIT_NEWTESTFUNC(tearDown_complex_test));
+@code
+$ gcc -I. -o runTestCaseRunner runTestCaseRunner.c testComplex.c complex.c -lccunit
+$ ./runTestRunner
+..F
+Time: 0.000036 sec
+
+FAILURES!!!
+Test Results: 
+Run 2, Failures 1
+There was 1 failure:
+testComplex.c:46: complex equals test:
+       complex_equals (c10_1, c1_1) != 0
 @endcode
 
+@english
+@japanese
+¤³¤ÎÎã¤Ç¤Ï¥Æ¥¹¥È¥±¡¼¥¹¤ò 2 ¸Ä¼Â¹Ô¤·¤Æ¡¢
+¤Ò¤È¤Ä¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ç¼ºÇÔ¤·¤Æ¤¤¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤¹¡£
+ºÇ½é¤Î¡Ö<code>..F</code>¡×¤Ç¤Ï¡¢
+¤Õ¤¿¤ÄÌܤΥƥ¹¥È¥±¡¼¥¹¤¬¼ºÇÔ¤·¤Æ¤¤¤ë¤³¤È¤ò¤¢¤é¤ï¤·¤Æ¤¤¤Þ¤¹¡£
+
+¤Þ¤¿¾å½Ò¤Î¤è¤¦¤Ë¡¢
+¼ºÇÔ¤·¤¿¥Õ¥¡¥¤¥ë̾¡¢¹ÔÈֹ桢¥Æ¥¹¥È¥±¡¼¥¹¤Î̾Á° (<code>complex equals test</code>)¡¢
+ɽÌÀ¤·¤¿¾ò·ï¤Îʸ»úÎó (<code>complex_equals (c10_1, c1_1) != 0</code>) ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+@endif
+
 @~english
-Once you have the Fixture in place, you can write as complex
-Test Cases as you'd like.
+That was a very simple test. Ordinarily, you'll have many
+little test cases that you'll want to run on the same set of
+objects. To do this, use global variables.
 @~japanese
-°ìÅÙ·è¤Þ¤Ã¤¿¤È¤³¤í¤Ë¥Õ¥£¥¯¥¹¥Á¥ã¤ò½ñ¤¤¤Æ¤·¤Þ¤¨¤Ð¡¢
-¤¢¤Ê¤¿¤¬¹¥¤­¤Ê¤è¤¦¤ËÊ£ÁÇ¿ô¤Î¥Æ¥¹¥È¥±¡¼¥¹¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¤³¤ì¤ÏÂçÊÑñ½ã¤Ê¥Æ¥¹¥È¤Ç¤¹¡£
+Ä̾
+¤¿¤¯¤µ¤ó¤Î¾®¤µ¤Ê¥Æ¥¹¥È´Ø¿ô¤òºî¤Ã¤Æ¡¢
+Ʊ¤¸¤è¤¦¤Ê¥Ç¡¼¥¿¤Î½¸¤Þ¤ê¤ò»È¤Ã¤Æ¥Æ¥¹¥È¤ò¹Ô¤¦¤Ç¤·¤ç¤¦¡£
+¤Ä¤Þ¤ê³Æ¥Æ¥¹¥È´Ø¿ô¶¦Ä̤Υ°¥í¡¼¥Ð¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
 @~
 
 @english
-@section test_case Test Case
+@section setUp_and_tearDown setUp and tearDown
 @japanese
-@section test_case ¥Æ¥¹¥È¥±¡¼¥¹
+@section setUp_and_tearDown setUp ¤È tearDown
 @endif
 
 @~english
-How do you write and invoke an individual test case when you
-have a Fixture?
+What if you have two or more tests that operate on the same
+similar set of objects?
 @~japanese
-¥Õ¥£¥¯¥¹¥Á¥ã¤ò°ì¤Ä½ñ¤¤¤¿¤È¤·¤Æ¡¢
-¤É¤¦¤ä¤Ã¤Æ¸Ä¡¹¤Î¥Æ¥¹¥È¥±¡¼¥¹¤ò½ñ¤¤¤Æ¼Â¹Ô¤¹¤ì¤ÐÎɤ¤¤Ç¤·¤ç¤¦¤«¡£
-@~
+¤â¤·Ê£¿ô¤Î¥Æ¥¹¥È´Ø¿ô¤¬¤¢¤ë¤Ê¤é¡¢
+Ʊ¤¸¥Ç¡¼¥¿¤Î½¸¤Þ¤ê¤ò¤¤¤¯¤Ä¤«»È¤¦¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
+@~
+
+@dot
+digraph TestCase {
+  node [ fontsize=9, fontname=Helvetica ]
+  edge [ fontsize=9, dir=back, arrowtail=vee ]
+  gv [ label="Global Variables", shape=box ]
+  { rank=same;
+    tc1 [ label="Test case 1" ];
+    tc2 [ label="Test case 2" ];
+    tcn [ label="Test case n" ];
+  }
+  gv -> tc1;
+  gv -> tc2 [ weight=8 ];
+  gv -> tcn;
+  tc2 -> tcn [ label="...", dir=none, color=white ];
+}
+@enddot
 
 @~english
-For example, to test the equality of two complex number,
-write:
+Tests need to run against the background of a known set of
+objects. This set of objects is called a test fixture. When
+you are writing tests you will often find that you spend
+more time writing the code to set up the fixture than you do
+in actually testing values.
 @~japanese
-Î㤨¤Ð¡¢Æó¤Ä¤ÎÊ£ÁÇ¿ô¤¬Åù¤·¤¤¡Ê¤Þ¤¿¤ÏÅù¤·¤¯¤Ê¤¤¡Ë¤³¤È¤ò¥Æ¥¹¥È¤¹¤ë¤Ë¤Ï¡¢
-¼¡¤Î¤è¤¦¤Ë½ñ¤­¤Þ¤¹¡£
+¥Æ¥¹¥È¤ÏÃæ¿È¤Î¤ï¤«¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î½¸¤Þ¤ê¤òÁ°Äó¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+¥Æ¥¹¥È¤ò½ñ¤¤¤Æ¤¤¤ë¤È¡¢
+¼ÂºÝ¤Ë¥Æ¥¹¥È¤¹¤ëÃͤò¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¥³¡¼¥É¤ò½ñ¤¯Êý¤Ë¡¢
+¤è¤ê»þ´Ö¤ò¤«¤±¤Æ¤¤¤ë¤³¤È¤Ëµ¤¤Å¤¯¤³¤È¤¬¤è¤¯¤¢¤ê¤Þ¤¹¡£
 @~
 
-@code
-void test_complex_equals ()
-{
-  CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s10_1, complex_to_string);
-  CCUNIT_ASSERT_TEST_OBJ (s10_1, !complex_equals, s1_1, complex_to_string);
-}
-
-...
+@english
+@japanese
+Î㤨¤ÐÁ°Àá¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ç¤Ï¡¢
+¤¤¤¯¤Ä¤«¤ÎÊ£ÁÇ¿ô¤ò³ä¤êÅö¤Æ¤¿¤ê²òÊü¤·¤¿¤ê¤·¤Æ¤¤¤Þ¤¹¡£
+@endif
 
-  ccunit_addNewTestCase (fixture,
-                         "test_complex_equals",
-                         "complex equals test",
-                         test_complex_equals);
-@endcode
+@~english
+Often, you will be able to use the same fixture for several
+different tests. Each case will send slightly different
+messages or parameters to the fixture and will check for
+different results.
+@~japanese
+¿¤¯¤Î¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤Î°Û¤Ê¤Ã¤¿¥Æ¥¹¥È¤Î¤¿¤á¤ËƱ¤¸¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¤½¤ì¤¾¤ì¤Î¥Æ¥¹¥È´Ø¿ô¤ò¼Â¹Ô¤¹¤ëÁ°¤ËÊÑ¿ô¤ò½é´ü²½¤·¡¢
+ÃͤòÄ´¤Ù¤ë¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
+¤½¤·¤Æ¥Æ¥¹¥È¤¬½ª¤ï¤Ã¤¿¤é¸å»ÏËö¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
+@~
+
+@dot
+digraph TestFixture {
+  node [ fontsize=9, fontname=Helvetica ]
+  edge [ fontsize=9, dir=back, arrowtail=vee ]
+  rankdir=TB;
+  gv [ label="Global Variables", shape=box ]
+  { rank=same;
+    su [ label="setUp" ];
+    tc [ label="TestCase" ];
+    td [ label="tearDown" ];
+  }
+  gv -> su [ label="initialize" ];
+  gv -> tc [ label="access" ];
+  gv -> td [ label="clean-up" ];
+}
+@enddot
 
 @~english
-One may create and run objects for each test case like this:
+When you have a common fixture, here is what you do:
 @~japanese
-°ì¤Ä¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¡¢
-¥Õ¥£¥¯¥¹¥Á¥ã¤òºîÀ®¤·¤Æ¤½¤ì¤¾¤ì¤Î¥Æ¥¹¥È¥±¡¼¥¹¤ò¼Â¹Ô¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¤â¤·³Æ¥Æ¥¹¥È¤Ë¶¦Ä̤Υ°¥í¡¼¥Ð¥ëÊÑ¿ô¤¬¤¢¤ì¤Ð¡¢
+¼¡¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¤·¤ç¤¦¡£
 @~
 
+@english
+For example, to write several test cases, first create a
+fixture:
+@japanese
+@endif
+
+@dontinclude complex/testComplexSetup.c
+
+@skipline complex.h
+@until c10_1;
+
+@english
+@japanese
+¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤·¤Þ¤¹¡£
+@endif
+
+@until }
+
+@english
+@japanese
+Ê£ÁÇ¿ô¤ò³ä¤êÅö¤Æ¤ë @c setUp ´Ø¿ô¤ò½ñ¤­¤Þ¤¹¡£
+@endif
+
+@until }
+
+@english
+@japanese
+³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë @c tearDown ´Ø¿ô¤ò½ñ¤­¤Þ¤¹¡£
+@endif
+
+@until test_complex_equals
+@until }
+
+@english
+@japanese
+¥Æ¥¹¥È´Ø¿ô¤ò½ñ¤­¤Þ¤¹¡£
+@endif
+
+@dontinclude complex/runTestCaseSetup.c
+@skip int main
+@until setUp_test_complex);
+@until tearDown_test_complex);
+
+@english
+@japanese
+@c setUp() ¤È @c tearDown() ¤òÅÐÏ¿¤·¤Þ¤¹¡£
+¤³¤Î»þ¡¢´Ø¿ô¤Î̾Á°¤¬ @c setUp/tearDown ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+@endif
+
+@until }
+
+@english
+@japanese
+¥Æ¥¹¥È¥±¡¼¥¹¤ò¼Â¹Ô¤·¡¢
+·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£
+@endif
+
+@english
+The sample code made in the above is in the directory <code>examples/complex</code>,
+the files are @c testComplexSetup.c and <code>runTestCaseSetup.c</code>.
+@japanese
+¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢@c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î
+<code>testComplexSetup.c, runTestCaseSetup.c</code> ¤Ë¤¢¤ê¤Þ¤¹¡£
+
+¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
+
 @code
-  CCUnitTestResult* result;
-  result = ccunit_runTestFixture (fixture);
+$ gcc -o runTestCaseSetup runTestCaseSetup.c testComplexSetup.c complex.c -lccunit
+$ ./runTestCaseSetup
+..
+Time: 0.000048 sec
+
+OK (2 tests)
 @endcode
 
-@~english
-When the test fixture is run, that specific test functions
-will be run.  This is not a useful thing to do, however, as
-no diagnostics will be displayed.  One will normally use a
-@link ExecutingTest TestRunner @endlink (see below) to
-display the results.
-@~japanese
-¥Æ¥¹¥È¥Õ¥£¥¯¥¹¥Á¥ã¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢
-ÆÃÄê¤Î¥Æ¥¹¥È´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¤¢¤Þ¤êÊØÍø¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¢
-¤Ê¤¼¤Ê¤é¡¢¿ÇÃǤ¬É½¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£
-Ä̾ï¤Ï @link ExecutingTest TestRunner @endlink
-(@ref test_runner ¸å½Ò)
-¤Ç·ë²Ì¤òɽ¼¨¤·¤Þ¤¹¡£
-@~
+@english
+@section one_time_setUp_tearDown setUp/tearDown of only one time
+@japanese
+@section one_time_setUp_tearDown °ì²ó¤À¤±¤Î setUp/tearDown
+@endif
+
+@english
+@japanese
+Á°¤ÎÀá¤Ç¤Ï¥Æ¥¹¥È¤´¤È¤ËËè²ó½é´ü²½¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
+°ì²ó¤À¤±½é´ü²½¤ò¹Ô¤Ã¤Æ¡¢
+Ê£¿ô¤Î¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤¿¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
+¤½¤·¤Æ¥Æ¥¹¥È¤¬Á´¤Æ½ª¤ï¤Ã¤¿¤È¤­¤À¤±¸å»ÏËö¤Î¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë¤è¤¦¤Ê¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
+
+¤½¤Î¤¿¤á¤Ë¤Ï¥Æ¥¹¥È¥±¡¼¥¹¤Ë
+@c setup_setUp/setup_tearDown ´Ø¿ô¤òÅÐÏ¿¤·¤Þ¤¹¡£
+¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ê½ç½ø¤Ç¥Æ¥¹¥È´Ø¿ô¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
+@endif
+
+@dot
+digraph TestCaseCallingSequence {
+  node [ fontsize=9, fontname=Helvetica ]
+  edge [ fontsize=9 ]
+  rankdir = LR;
+  { rank=same;
+    setUp;
+    setUp2 [ label="setUp" ];
+  }
+  setup_setUp -> setUp [ weight=8 ];
+  setup_setUp -> setUp2 [ style=invis ];
+  setUp -> "TestFunc 1" [ weight=8 ];
+  "TestFunc 1" -> tearDown [ weight=8 ];
+  setUp2 -> "TestFunc n" [ weight=8 ];
+  tearDown2 [ label="tearDown" ];
+  "TestFunc n" -> tearDown2;
+  tearDown2 -> setup_tearDown;
+  tearDown -> setUp2;
+}
+@enddot
 
-@~english
-Once you have several tests, organize them into a suite.
-@~japanese
-°ìÅÙ¤¤¤¯¤Ä¤«¤Î¥Æ¥¹¥È¤òºî¤Ã¤¿¤é¡¢
-¤½¤ì¤é¤ò¥¹¡¼¥Ä¤ËÀ°Íý¤·¤Þ¤¹¡£
-@~
 
 @english
 @section suite Suite
@@ -336,24 +603,39 @@ Once you have several tests, organize them into a suite.
 
 @~english
 How do you set up your tests so that you can run them all at once?
+Once you have several tests, organize them into a suite.
 @~japanese
-°ìÅ٤˥ƥ¹¥È¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë½àÈ÷¤¹¤ë¤Ë¤Ï¡¢
+Ê£¿ô¤Î¥Æ¥¹¥È¤òÁ´Éô°ìÅ٤˼¹Ԥ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë½àÈ÷¤¹¤ë¤Ë¤Ï¡¢
 ¤É¤Î¤è¤¦¤Ë¤·¤¿¤é¤¤¤¤¤Ç¤·¤ç¤¦¤«¡©
-@~
+¤¤¤¯¤Ä¤«¤Î¥Æ¥¹¥È¤òºî¤Ã¤¿¤é¡¢
+¤½¤ì¤é¤ò¥¹¡¼¥Ä (¥¹¥¤¡¼¥È) ¤ËÀ°Íý¤·¤Þ¤¹¡£
+@~
+
+@dot
+digraph TestStructure {
+  node [ fontsize=9, fontname=Helvetica ];
+  edge [ dir=back, fontsize=9 ];
+  TestSuite -> TestSuite [ label="1..n" ];
+  TestCase;
+  TestSuite -> TestCase [ label="1..n" ];
+  TestCase -> setup_setUp [ label="0..1" ];
+  TestCase -> setUp [ label="0..1" ];
+  TestFunc;
+  TestCase -> TestFunc [ label="1..n" ];
+  TestCase -> tearDown [ label="0..1" ];
+  TestCase -> setup_tearDown [ label="0..1" ];
+}
+@enddot
 
 @~english
 CCUnit provides a @link CCUnitTestSuite TestSuite @endlink
-module that runs any number of TestCases together.
+module that runs any number of TestFuncs together.
+You saw, above, how to run test suite.
 @~japanese
-CCUnit ¤Ï¤¤¤¯¤Ä¤â¤Î @link CCUnitTestCase TestCases @endlink
+CCUnit ¤Ï¤¤¤¯¤Ä¤â¤Î @link CCUnitTestFunc TestFuncs @endlink
 ¤ò°ì½ï¤Ë¼Â¹Ô¤¹¤ë
 @link CCUnitTestSuite TestSuite @endlink ¥â¥¸¥å¡¼¥ë¤òÄ󶡤·¤Þ¤¹¡£
-@~
-
-@~english
-You saw, above, how to run test fixture.
-@~japanese
-¥Æ¥¹¥È¥Õ¥£¥¯¥¹¥Á¥ã¤ò¼Â¹Ô¤¹¤ëÊýË¡¤Ï¾å½Ò¤·¤Þ¤·¤¿¡£
+¥Æ¥¹¥È¥¹¡¼¥Ä¤ò¼Â¹Ô¤¹¤ëÊýË¡¤Ï¤¹¤Ç¤ËÁ°¤ÎÊý¤Ç¼¨¤·¤Æ¤¢¤ê¤Þ¤¹¡£
 @~
 
 @~english
@@ -362,458 +644,275 @@ To create a suite of two or more tests, you do the following:
 Æó¤Ä°Ê¾å¤Î¥Æ¥¹¥È¤ò´Þ¤à°ì¤Ä¤Î¥¹¡¼¥Ä¤òºî¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
 @~
 
+@dontinclude complex/runTestSuite.c
+
+@skip main
+@until test_complex_div);
+
+@english
+@japanese
+¥Æ¥¹¥È¥±¡¼¥¹¤òÆó¤ÄÀ¸À®¤·¡¢¤½¤ì¤¾¤ì¤Ë¥Æ¥¹¥È´Ø¿ô¤òÅÐÏ¿¤·¤Þ¤¹¡£
+@endif
+
+@until testArith);
+
+@english
+@japanese
+¥Æ¥¹¥È¥¹¡¼¥Ä¤òÀ¸À®¤·¡¢
+¥Æ¥¹¥È¥±¡¼¥¹¤òÅÐÏ¿¤·¤Þ¤¹¡£
+@endif
+
+@until }
+
+@english
+@japanese
+¥Æ¥¹¥È¥é¥ó¥Ê¡¼¤òÀ¸À®¤·¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
+@endif
+
+@english
+The sample code made in the above is in the directory <code>examples/complex</code>,
+the files are <code>runTestSuite.c</code>, <code>testComplexSetup.c</code>
+and <code>testComplexArith.c</code>.
+@japanese
+¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢<code>examples/complex</code> ¥Ç¥£¥ì¥¯¥È¥ê¤Î
+<code>runTestSuite.c, testComplexSetup.c, testComplexArith.c</code>
+¤Ë¤¢¤ê¤Þ¤¹¡£
+
+¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
+
 @code
-CCUnitTestSuite* suite;
-CCUnitTestFixture* fixture;
-CCUnitTestResult* result;
-suite = ccunit_newTestSuite ("Complex test suite");
-fixture = ccunit_newTestFixture ("Complex Tests",
-                                 CCUNIT_NEWTESTFUNC(setUp_complex_test),
-                                 CCUNIT_NEWTESTFUNC(tearDown_complex_test));
-ccunit_addNewTestCase (fixture, "test_complex_equals", "complex equals test",
-                       test_complex_equals);
-ccunit_addNewTestCase (fixture, "test_complex_add", "complex add test",
-                       test_complex_add);
-ccunit_addNewTestCase (fixture, "test_complex_sub", "complex sub test",
-                       test_complex_sub);
-ccunit_addTestFixture (suite, fixtuer);
-result = ccunit_runTestSuite (suite, NULL);
+$ gcc -I. -o runTestSuite runTestSuite.c testComplexSetup.c testComplexArith.c complex.c -lccunit
+$ ./runTestSuite
+......
+Time: 0.000061 sec
+
+OK (6 tests)
 @endcode
 
-@~english
+@english
 @link CCUnitTestSuite TestSuites @endlink don't only have to
-contain @link CCUnitTestFixture TestFixtures @endlink.  They
+contain @link CCUnitTestCase TestCases @endlink.  They
 can contain any object that implements the @link CCUnitTest
 Test @endlink interface.  For example, you can create a
 @link CCUnitTestSuite TestSuite @endlink
-(<code>complex_add_sub_suite ()</code>) in your code and I
-can create one in mine
-(<code>complex_mul_div_suite ()</code>), and we can run them together by
+in your code and I
+can create one in mine, and we can run them together by
 creating a @link CCUnitTestSuite TestSuite @endlink that
 contains both:
-@~japanese
+@japanese
 @link CCUnitTestSuite TestSuites @endlink ¤Ï
-@link CCUnitTestFixture TestFixtures @endlink
+@link CCUnitTestCase TestCases @endlink
 ¤ò´Þ¤à¤À¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
 @link CCUnitTestSuite TestSuites @endlink ¼«¿È¤ò´Þ¤à¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-<!--
-¤½¤ì¤é¤Ï @link CCUnitTest Test @endlink
-¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¤É¤ó¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤â´Þ¤á¤é¤ì¤Þ¤¹¡£
--->
 Î㤨¤Ð¡¢¤¢¤Ê¤¿¤Ï¤¢¤Ê¤¿¤Î¥³¡¼¥É¤Ë @link CCUnitTestSuite TestSuite @endlink
-(<code>complex_add_sub_suite ()</code>)
 ¤òºî¤ë¤³¤È¤¬¤Ç¤­¡¢
 ¤½¤·¤Æ»ä¤Ï»ä¤Î¥¹¡¼¥Ä
-(<code>complex_mul_div_suite ()</code>)
 ¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¢
 ¤½¤·¤Æ»äã¤ÏξÊý¤È¤â¤ò´Þ¤ó¤Ç¤¤¤ë @link CCUnitTestSuite TestSuite @endlink
-¤òºî¤Ã¤Æ°ì½ï¤Ë¤½¤ì¤¾¤ì¤Î¥¹¡¼¥Ä¤òÆ°¤«¤¹¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ç¤¹¡£
-@~
+¤òºî¤Ã¤Æ¡¢
+°ì½ï¤Ë¤½¤ì¤¾¤ì¤Î¥¹¡¼¥Ä¤òÆ°¤«¤¹¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ç¤¹¡£
+@endif
 
 @code
-CCUnitTestSuite* suite;
-CCUnitTestResult* result;
-suite = ccunit_newTestSuite ("Complex add/sub/mul/div test suite");
-ccunit_addTestSuite (suite, complex_add_sub_suite ());
-ccunit_addTestSuite (suite, complex_mul_div_suite ());
-result = ccunit_runTestSuite(suite, NULL);
-@endcode
+  CCUnitTestSuite* suite;
+  CCUnitTestSuite* suite_a;
+  CCUnitTestSuite* suite_b;
+
+  ...
+
+  suite = ccunit_newTestSuite ("complex all test suite");
+  suite_a = ccunit_newTestSuite ("complex test suite A");
+  suite_b = ccunit_newTestSuite ("complex test suite B");
 
+  ...
+
+  ccunit_addTestSuite (suite, suite_a);
+  ccunit_addTestSuite (suite, suite_b);
+@endcode
 
 @english
-@section test_runner TestRunner
+@section helper_tool Helper Tool
 @japanese
-@section test_runner ¥Æ¥¹¥È¥é¥ó¥Ê¡¼
+@section helper_tool ¥Ø¥ë¥Ñ¡¼¥Ä¡¼¥ë
 @endif
 
-@~english
-How do you run your tests and collect their results?
-@~japanese
-¤É¤¦¤ä¤Ã¤Æ¥Æ¥¹¥È¤ò¼Â¹Ô¤·¡¢¤½¤Î·ë²Ì¤ò½¸¤á¤¿¤éÎɤ¤¤Ç¤·¤ç¤¦¤«¡£
-@~
+@english
+As you might have noticed, implementing the <code>suite
+()</code> function of testCase is a repetitive and error
+prone task. A @ref CreatingTestSuite set of functions and
+command have been created to automatically implements the
+<code>suite()</code> function.
+@japanese
+¤ªµ¤¤Å¤­¤Î¤è¤¦¤Ë¡¢
+¥Æ¥¹¥È¥±¡¼¥¹¤Ë¥Æ¥¹¥È´Ø¿ô¤òÅÐÏ¿¤·¤¿¤ê¡¢
+¥Æ¥¹¥È¥¹¡¼¥Ä¤Ë¥Æ¥¹¥È¥±¡¼¥¹¤òÅÐÏ¿¤·¤¿¤ê¤¹¤ëºî¶È¤Ï¡¢
+È¿ÉüŪ¤Ç´Ö°ã¤¤¤ä¤¹¤¤¤â¤Î¤Ç¤¹¡£
+Î㤨¤Ð @c testComplexSetup.c ¤Ë¤Ï
+@c test_complex_to_string() ¤È¤¤¤¦¥Æ¥¹¥È´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
+º£¤Þ¤Ç¤ÎÀâÌÀ¤Ç¤Ï̵»ë¤µ¤ì¤Æ¤¤¤Æ¥Æ¥¹¥È¥±¡¼¥¹¤Ë¤ÏÅÐÏ¿¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£
+¤³¤Î¤è¤¦¤ÊÅÐϿϳ¤ì¤ò¤Ê¤¯¤¹¤¿¤á¤Ë
+@ref CreatingTestSuite ¤Î´Ø¿ô¤Î½¸¤Þ¤ê¤È¥³¥Þ¥ó¥É¤Ï¡¢
+¥Æ¥¹¥È¥±¡¼¥¹¤ä¥Æ¥¹¥È¥¹¡¼¥Ä¤òÅÐÏ¿¤¹¤ë´Ø¿ô¤Î¼ÂÁõ¤ò¡¢
+¼«Æ°Åª¤ËºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+@endif
 
-@~english
-Once you have a test suite, you'll want to run it. %CCUnit
-provides tools to define the suite to be run and to display
-its results.  You make your suite accessible to a @link
-CreatingTestSuite ccunit_makeSuite @endlink tool that generate a
-creating test suite code.
-@~japanese
-°ì¤Ä¥Æ¥¹¥È¥¹¡¼¥Ä¤ò½ñ¤¤¤¿¤é¡¢
-¤½¤ì¤ò¼Â¹Ô¤·¤¿¤¤¤Ç¤·¤ç¤¦¡£
-CCUnit ¤Ï¥¹¡¼¥Ä¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÄêµÁ¤·¡¢
-·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Î¥Ä¡¼¥ë¤òÄ󶡤·¤Þ¤¹¡£
-¥¹¡¼¥Ä¤ò @link CreatingTestSuite ccunit_makeSuite @endlink
-¥Ä¡¼¥ë¤ËÆþÎϤǤ­¤ë¤è¤¦¤Ê·Á¼°¤Ç½ñ¤¯¤³¤È¤Ç¡¢
-¥Æ¥¹¥È¥¹¡¼¥Ä¤òºîÀ®¤¹¤ë¥³¡¼¥É¤ò¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@~
+@english
+@japanese
+¥Æ¥¹¥È¥±¡¼¥¹¤ò½ñ¤¯¥Õ¥¡¥¤¥ë¤Ï¼¡¤Î¤è¤¦¤Ëºî¤ê¤Þ¤¹¡£
 
-@~english
-For example, to make a ComplexTest suite available to a
-@link CreatingTestSuite ccunit_makeSuite @endlink,
-excute the following tool to
-testComplex.c:
-@~japanese
-Î㤨¤Ð¡¢ComplexTest ¥¹¡¼¥Ä¤ò
-@link CreatingTestSuite ccunit_makeSuite @endlink
-¤ò»È¤Ã¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢
-°Ê²¼¤Î¥Ä¡¼¥ë¤ò testComplex.c ¤Ë¼Â¹Ô¤·¤Þ¤¹¡£
-@~
+ºÇ½é¤Ë¡¢¥Æ¥¹¥È¥¹¡¼¥Ä¤òÀë¸À¤·¤Þ¤¹¡£
+¤³¤ì¤Ï javaDoc ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥ÈÆâ¤Ë¥Æ¥¹¥È¥¹¡¼¥Ä¤Î̾Á°¤òµ­½Ò¤·¤Þ¤¹¡£
+javaDoc¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤È¤Ï C ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¥Ö¥í¥Ã¥¯¤Î³«»Ï¤¬
+Æó¤Ä¤Î¥¢¥¹¥¿¥ê¥¹¥¯ <tt>**</tt> ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£
+@endif
 
 @code
-$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c
+//** test suite: complex test suite *\/
 @endcode
 
-@anchor test_runner_code
-@~english
-@~japanese
-<code>complex_suite</code> ¤È¤¤¤¦´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤¿¡¢
-<code>suiteComplex.c</code> ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
-@~
-
-@~english
-To use the TestRunner, include the header files for the tests in runTest.c:
-@~japanese
-TestRunner ¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢
-Î㤨¤Ð runTest.c ¤Ç¥Æ¥¹¥È¤Î¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£
-@~
+@english
+@japanese
+¼¡¤Ë¡¢
+¥Æ¥¹¥È¥±¡¼¥¹¤òÄêµÁ¤·¤Þ¤¹¡£
+¥Æ¥¹¥È¥±¡¼¥¹¤Ï javaDoc ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤Ë½ñ¤«¤ì¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Î̾Á°¤ÎÀë¸À¤È¡¢
+¥Æ¥¹¥È¥±¡¼¥¹¤Î½ªÎ»¤ÎÀë¸À¤Ç°Ï¤Þ¤ì¤¿¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤È´Ø¿ô¤Î½¸¤Þ¤ê¤Ç¤¹¡£
+¤Ò¤È¤Ä¤Î¥Õ¥¡¥¤¥ë¤ËÊ£¿ô¤Î¥Æ¥¹¥È¥±¡¼¥¹¤òÄêµÁ¤Ç¤­¤Þ¤¹¡£
+@endif
 
 @code
-#include <ccunit/CCUnitTestRunner.h>
-#include <ccunit/CCUnitTestSuite.h>
-@endcode
+//** test case: complex test case *\/
 
-@~english
-And call to
-@link ccunit_runTestRunner()
-ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink
-in the <code>main()</code> function:
-@~japanese
-¤½¤·¤Æ@link ccunit_runTestRunner()
-ccunit_runTestRunner (CCUnitTestRunner*, CCUnitTestSuite *) @endlink
-¤ò<code>main()</code>´Ø¿ô¤Ç¼Â¹Ô¤·¤Þ¤¹¡£
-@~
+static complex_t* c10_1;
 
-@code
-extern CCUnitTestSuite* complex_suite(const char* name);
-
-int main( int argc, char **argv)
+//** test new *\/
+void test_complex_new ()
 {
-  CCUnitTestRunner* runner;
-  CCUnitTestSuite* suite;
-  runner = ccunit_newTestRunner (stdout);
-  suite = complex_suite ("complex test suite");
-  return ccunit_runTestRunner (runner, suite);
+  ...
 }
-@endcode
 
-@~english
-The @link ExecutingTest TestRunner @endlink will run the tests.
-If all the tests pass, you'll get an informative message.
-If any fail, you'll get the following information:
-@~japanese
-@link ExecutingTest TestRunner @endlink ¤Ï¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-¤â¤·¤¹¤Ù¤Æ¤Î¥Æ¥¹¥È¤¬¥Ñ¥¹¤¹¤ì¤Ð¡¢¤½¤Î¾ðÊó¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-¤â¤·¤É¤ì¤«¤¬¼ºÇÔ¤¹¤ì¤Ð¡¢¤½¤ì¤Ë¤Ä¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ê¾ðÊó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-@~
+...
 
-<ul>
-<li>@~english
-    The name of the source file that contains the test
-    @~japanese
-    ¥Æ¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾
-    @~
-</li>
-<li>@~english
-    The line number where the failure occurred
-    @~japanese
-    ¼ºÇÔ¤¬µ¯¤³¤Ã¤¿¹ÔÈÖ¹æ
-    @~
-</li>
-<li>@~english
-    The name of the test case that failed
-    @~japanese
-    ¼ºÇÔ¤·¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Î̾Á°
-    @~
-</li>
-<li>@~english
-    All of the text inside the call to
-    <code>CCUNIT_ASSERT ()</code> which detected the failure
-    @~japanese
-    ¼ºÇÔ¤ò¸¡ÃΤ·¤¿<code>CCUNIT_ASSERT ()</code>¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¤Î¾ò·ï¤Îʸ»úÎó¡£
-    @~
-</li>
-</ul>
+//** end test case *\/
+//** test case: complex arith test case *\/
+...
+//* end test case *\/
+//* end test suite *\/
+//* test suite: ... *\/
+...
+//* end test suite *\/
+@endcode
 
 @english
-@section helper_macros Helper Tool
 @japanese
-@section helper_macros ¥Ø¥ë¥Ñ¡¼¥Ä¡¼¥ë
+¥Æ¥¹¥È´Ø¿ô¤Ï̾Á°¤¬ @c test ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+¤Þ¤¿³Æ¥Æ¥¹¥È´Ø¿ô¤ÎÁ°¤Ë¤Ï
+javaDoc ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤ÎÃæ¤Ë¥Æ¥¹¥È´Ø¿ô¤ÎÀâÌÀ¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¥³¥á¥ó¥È¤¬½ñ¤«¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
+¥Æ¥¹¥È´Ø¿ô¤Î̾Á°¤¬´Ø¿ô¤ÎÀâÌÀ¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Þ¤¹¡£
+
+ÆÃÊ̤ʥƥ¹¥È´Ø¿ô¤È¤·¤Æ @c setUp, @c tearDown, @c setup_setUp, @c setup_tearDown
+¤¬¤¢¤ê¤Þ¤¹¡£
+¤½¤Î̾Á°¤«¤é¤ï¤«¤ë¤è¤¦¤Ë¡¢
+°ÊÁ°¤ËÀâÌÀ¤·¤¿¥Æ¥¹¥È¥±¡¼¥¹¤Îµ¡Ç½¤Î´Ø¿ô¤È¤·¤ÆƯ¤­¤Þ¤¹¡£
+¤½¤ì¤¾¤ì¤½¤Î¤è¤¦¤Ê̾Á°¤ÇÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤¡£
 @endif
 
-@~english
-As you might have noticed, implementing the <code>suite
-()</code> function of fixture is a repetitive and error
-prone task. A @ref CreatingTestSuite set of functions and
-command have been created to automatically implements the
-<code>suite()</code> function.
-@~japanese
-¤ªµ¤¤Å¤­¤Î¤è¤¦¤Ë¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤Î <code>suite ()</code>´Ø¿ô¤ò¼ÂÁõ¤¹¤ë¤Î¤Ï¡¢
-È¿ÉüŪ¤Ç´Ö°ã¤¤¤ä¤¹¤¤ºî¶È¤Ç¤¹¡£
-@ref CreatingTestSuite ¤Î´Ø¿ô¤Î¥»¥Ã¥È¤È¥³¥Þ¥ó¥É¤Ï<code>suite ()</code>
-´Ø¿ô¤Î¼ÂÁõ¤ò¼«Æ°Åª¤ËºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@~
-
-@dontinclude complex/testComplex.c
-
-@~english
-The following code is a rewrite of ComplexTest using those command:
-@~japanese
-°Ê²¼¤Î¥³¡¼¥É¤Ï¤½¤ì¤é¤Î¥³¥Þ¥ó¥É¤¬»È¤¦¤è¤¦¤ËComplexTest¤ò½ñ´¹¤¨¤¿¤â¤Î¤Ç¤¹¡£
-@~
-
-@code
-#include <ccunit/CCUnitAssert.h>
-@endcode
-
-@~english
-First, you declare the fixture, passing the test fixture
-name to the javaDoc style comment, which consist of a
-C-style comment block starting with two <tt>*</tt>'s:
-@~japanese
-ºÇ½é¤Ë¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤òÀë¸À¤·¤Þ¤¹¡£
-¤³¤ì¤ÏjavaDoc¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥ÈÆâ¤Ë¥Õ¥£¥¯¥¹¥Á¥ã¤Î̾Á°¤òµ­½Ò¤·¤Þ¤¹¡£
-javaDoc¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤È¤Ï C ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¥Ö¥í¥Ã¥¯¤Î³«»Ï¤¬
-Æó¤Ä¤Î¥¢¥¹¥¿¥ê¥¹¥¯ <tt>**</tt> ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£
-@~
-
-@code
-//** test case: complex number test *\/
-@endcode
+@english
+To generate creating suite function code, run
+<code>ccunit_makeSuite</code> tool.
+@japanese
+¥¹¡¼¥ÄºîÀ®´Ø¿ô¤Î¥³¡¼¥É¤òÀ¸À®¤¹¤ë¤Ë¤Ï¡¢
+<code>ccunit_makeSuite</code>¥Ä¡¼¥ë¤ò¼Â¹Ô¤·¤Þ¤¹¡£
+@endif
 
-@~english
+@english
 The function to make @link CCUnitTestSuite TestSuite
 @endlink is <code>ccunit_suite</code>.
 But, it can be changed to another
 name by the <code>-f</code> option of the
 <code>ccunit_makeSuite</code> command, too.
-Then, you define each test case of the fixture with prefix
-<code>test</code>, <code>setUp</code>,
-<code>tearDown</code>:
-
-@~japanese
+@japanese
+¼«Æ°Åª¤ËºîÀ®¤µ¤ì¤ë
 @link CCUnitTestSuite TestSuite @endlink
-¤òºîÀ®¤¹¤ë´Ø¿ô¤Ï <code>ccunit_suite</code> ¤Ç¤¹¡¢
+¤òºîÀ®¤¹¤ë´Ø¿ô¤Ï¡¢
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï <code>ccunit_suite</code> ¤Ç¤¹¡¢
 ¤·¤«¤· <code>ccunit_makeSuite</code> ¥³¥Þ¥ó¥É¤Î
 <code>-f</code> ¥ª¥×¥·¥ç¥ó¤ÇÊ̤Î̾Á°¤ËÊѤ¨¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-¤½¤·¤Æ¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ë¤Ï¤½¤ì¤¾¤ì̾Á°¤ÎÀèƬ¤Ë¡¢
-<code>test</code>, <code>setUp</code>,
-<code>tearDown</code> ¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£
-@~
+@endif
 
 @code
-#include <complex.h>
-
-static complex_t* s10_1;
-static complex_t* s1_1;
-static complex_t* s11_2;
-
-void setUp_complex_test ()
-{
-  s10_1 = complex_new (10, 1);
-  s1_1 = complex_new (1, 1);
-  s11_2 = complex_new (11, 2);
-}
-
-void tearDown_complex_test ()
-{
-  complex_delete (s10_1);
-  complex_delete (s1_1);
-  complex_delete (s11_2);
-}
+$ ccunit_makeSuite -f suite_test_complex -o suiteTestComplex.c testComplexSetup.c testComplexArith.c
+@endcode
 
-//** test equals *\/
-void test_complex_equals ()
-{
-  CCUNIT_ASSERT_TEST_OBJ (s10_1, complex_equals, s10_1, complex_to_string);
-  CCUNIT_ASSERT_TEST_OBJ (s10_1, !complex_equals, s1_1, complex_to_string);
-}
+@english
+@japanese
+¼«Æ°À¸À®¤·¤¿¥³¡¼¥É¤òÍøÍѤ¹¤ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
 
-//** test add *\/
-void test_complex_add ()
-{
-  complex_t c10_1 = { 10.0, 1.0 };
-  complex_t c1_1 = { 1.0, 1.0 };
-  complex_t result;
-  complex_t c11_2 = { 11.0, 2.0 };
-  CCUNIT_ASSERT (complex_equals (&c11_2, complex_add (&result, &c10_1, &c1_1)));
-}
+@dontinclude complex/runTestSuiteAuto.c
 
-//** test sub *\/
-void test_complex_sub ()
-{
-  complex_t c9_0 = { 9, 0 };
-  complex_t result;
-  CCUNIT_ASSERT_TEST_OBJ (&c9_0, complex_equals,
-                         complex_sub (&result, s10_1, s1_1),
-                         complex_to_string);
-}
-@endcode
+@skip include
+@until extern
 
-@~english
-Finally, you end the fixture declaration:
-@~japanese
-ºÇ¸å¤Ë¡¢¥Õ¥£¥¯¥¹¥Á¥ã¤Î½ª¤ê¤òÀë¸À¤·¤Þ¤¹¡£
-@~
+@english
+@japanese
+À¸À®¤·¤¿´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤òÀë¸À¤·¤Þ¤¹¡£
+°ú¿ô¤Î <code>char* name</code> ¤ò˺¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+@endif
 
-@code
-//** end test case *\/
-@endcode
+@skip main
+@until suite_test_complex
 
-@~english
-To generate creating suite function code, run
-<code>ccunit_makeSuite</code> tool.
-@~japanese
-¥¹¡¼¥ÄºîÀ®´Ø¿ô¤Î¥³¡¼¥É¤òÀ¸À®¤¹¤ë¤Ë¤Ï¡¢
-<code>ccunit_makeSuite</code>¥Ä¡¼¥ë¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-@~
+@english
+@japanese
+À¸À®¤·¤¿´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¥Æ¥¹¥È¥¹¡¼¥Ä¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
+@endif
 
-@code
-$ ccunit_makeSuite -f complex_suite -o suiteComplex.c testComplex.c
-$ cat suiteComplex.c
-
-#include <ccunit/CCUnitTestSuite.h>
-#include <ccunit/CCUnitTestFixture.h>
-#include <ccunit/CCUnitTestCase.h>
-
-//* test fixture: complex number test *\/
-//* setUp_complex_test *\/
-extern void setUp_complex_test ();
-//* tearDown_complex_test *\/
-extern void tearDown_complex_test ();
-//* test_complex_equals *\/
-extern void test_complex_equals ();
-//* test_complex_add *\/
-extern void test_complex_add ();
-//* test_complex_sub *\/
-extern void test_complex_sub ();
-
-static CCUnitTestFunc fx_001_cases[] = {
-  {
-    "test_complex_equals",
-    "test equals",
-    test_complex_equals
-  },
-  {
-    "test_complex_add",
-    "test add",
-    test_complex_add
-  },
-  {
-    "test_complex_sub",
-    "test sub",
-    test_complex_sub
-  },
-  {
-    NULL, NULL, NULL
-  },
-};
-
-static CCUnitTestFixtureDfn fx_001 = {
-  { ccunitTypeFixture },
-  "complex number test",
-  {
-    "setUp_complex_test",
-    "setUp_complex_test",
-    setUp_complex_test
-  },
-  {
-    "tearDown_complex_test",
-    "tearDown_complex_test",
-    tearDown_complex_test
-  },
-  fx_001_cases,
-};
-
-static CCUnitTestDfn* suite_001_test[] = {
-    &fx_001.test,
-    NULL,
-};
-
-static CCUnitTestSuiteDfn suite_001 = {
-  { ccunitTypeSuite },
-  "",
-  suite_001_test
-};
-
-
-CCUnitTestSuite* complex_suite (const char* name)
-{
-  if (!suite_001.name[0])
-    suite_001.name = name;
-  return ccunit_newTestSuiteFromDfn (&suite_001);
-}
-$
-@endcode
+@until }
 
 @english
-@section post_build_check Post-build check
 @japanese
-@section post_build_check ¥Ó¥ë¥É¸å¤Î¥Á¥§¥Ã¥¯
+¥Æ¥¹¥È¥é¥ó¥Ê¡¼¤Ç¼Â¹Ô¤·¤Þ¤¹¡£
 @endif
 
-@~english
-Now that we have our unit tests running, how about
-integrating unit testing to our build process ?
-@~japanese
-¤µ¤¢¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤ò¼Â¹Ô¤¹¤ë½àÈ÷¤¬¤Ç¤­¤Þ¤·¤¿¡£
-¤Ç¤Ï¥Ó¥ë¥É¥×¥í¥»¥¹¤Ë¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤òÅý¹ç¤¹¤ë¤Ë¤Ï¤É¤¦¤·¤¿¤é¤¤
-¤¤¤Ç¤·¤ç¤¦¡£
-@~
-
-@~english
-To do that, the application must returns a value different than 0 to indicate that
-there was an error.
-@~japanese
-¤½¤¦¤¹¤ë¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤³¤È¤ò¼¨¤¹
-£°°Ê³°¤ÎÃͤòÊÖ¤µ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@~
 
-@~english
-@link ccunit_runTestRunner() ccunit_runTestRunner() @endlink returns
-a integer indicating if the run was successful.
-@~japanese
-@link ccunit_runTestRunner() ccunit_runTestRunner() @endlink
-¤Ï¡¢¼Â¹Ô¤¬À®¸ù¤·¤¿¤«¤É¤¦¤«¤ò¼¨¤¹À°¿ô¤òÊÖ¤·¤Þ¤¹¡£
-@~
+@english
+The sample code made in the above is in the directory <code>examples/complex</code>,
+the files are <code>runTestSuite.c</code>, <code>testComplex.c</code>
+and <code>testComplexArith.c</code>.
+@japanese
+¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢<code>examples/complex</code> ¥Ç¥£¥ì¥¯¥È¥ê¤Î
+<code>runTestSuiteAuto.c, testComplexSetup.c</code>
+¤Ë¤¢¤ê¤Þ¤¹¡£
 
-@~english
-Updating our main programm, we obtains:
-@~japanese
-¼¡¤Î¤è¤¦¤Ë¥á¥¤¥ó¥×¥í¥°¥é¥à¤ò¹¹¿·¤·¤Þ¤¹¡£
-@~
+¥³¥ó¥Ñ¥¤¥ë¤ª¤è¤Ó¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
 
 @code
-#include <ccunit/CCUnitTestRunner.h>
+$ ccunit_makeSuite -f suite_test_complex -o suiteTestComplex.c testComplexSetup.c testComplexArith.c
+$ gcc -I. -o runTestSuiteAuto runTestSuiteAuto.c testComplexSetup.c testComplexArith.c suiteTestComplex.c complex.c -lccunit
+$ ./runTestSuiteAuto
+.......
+Time: 0.000060 sec
 
-int main (int argc, char** argv)
-{
-  CCUnitTestRunner* runner;
-  CCUnitTestSuite* suite;
-  int wasSucessful;
-  runner = ccunit_newTestRunner (stdout);
-  suite = ccunit_suite ();
-  wasSucessful = ccunit_runTestRunner (runner, suite);
-  return wasSucessful;
-}
+OK (7 tests)
 @endcode
 
-@~english
-Now, you need to run your application after compilation.
-The sample program made in the above is in the examples/complex directory.
-@~japanese
-¤½¤ì¤Ç¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿¸å¤Ë¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
-°Ê¾å¤ÇºîÀ®¤·¤¿¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
-@~
+@copydetails CCUnitMakeSuite
+
+@english
+@section sample_programs Sample Programs
+@japanese
+@section sample_programs ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à
+@endif
+
+@english
+The sample program made in the above is in the @c examples/complex directory.
+@japanese
+°Ê¾å¤ÇºîÀ®¤·¤¿¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï @c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
+@endif
+
+@copydetails examples
 
 */