OSDN Git Service

I added the English explanation to the section simple_test_case.
authortsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 22 Aug 2010 03:27:36 +0000 (03:27 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Sun, 22 Aug 2010 03:27:36 +0000 (03:27 +0000)
doc/cookbook.dox

index 7dfb571..60b649a 100644 (file)
@@ -42,23 +42,23 @@ Here is a short cookbook to help you get started.
 @section simple_test_case ¥·¥ó¥×¥ë¤Ê¥Æ¥¹¥È¥±¡¼¥¹
 @endif
 
-@~english
+@english
 Tests in <b>CCUnit</b> can be run automatically.  They are
 easy to set up and once you have written them, they are
 always there to help you keep confidence in the quality of
 your code.
-@~japanese
-CCUnit¤ò»È¤Ã¤¿¥Æ¥¹¥È¤Ï¼«Æ°Åª¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+@japanese
+<b>CCUnit</b> ¤ò»È¤Ã¤¿¥Æ¥¹¥È¤Ï¼«Æ°Åª¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
 CCUnit ¤Î¥Æ¥¹¥È¤Ï´Êñ¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢
 °ìÅ٥ƥ¹¥È¤ò½ñ¤¤¤Æ¤·¤Þ¤¨¤Ð¡¢
 ¤¤¤Ä¤Ç¤â¥×¥í¥°¥é¥à¤ÎÉʼÁ¤ò¿®Íê¤Ç¤­¤ë¤â¤Î¤ËÊݤĤ³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-@~
+@endif
 
-@~english
+@english
 To make a simple test, here is what you do:
-@~japanese
-ñ½ã¤Ê¥Æ¥¹¥È¤òºî¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
-@~
+@japanese
+´Êñ¤Ê¥Æ¥¹¥È¤òºî¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
+@endif
 
 <ol>
 <li> @english Create a test function
@@ -70,30 +70,30 @@ To make a simple test, here is what you do:
      and pass a bool that is true if the test succeeds
 
      ASSERT macro is listed in others as well in
-     @link Assertions Making assertions @endlink.
+     @ref Assertions.
      @japanese
      Ãͤò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢
      @link CCUNIT_ASSERT() CCUNIT_ASSERT(bool) @endlink
      ¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢
      ¥Æ¥¹¥È¤¬À®¸ù¤¹¤ë¤Ê¤é¿¿¤òÊÖ¤¹¤è¤¦¤Ê¿¿µ¶ÃͤòÅϤ·¤Þ¤¹¡£
 
-     ASSERT ´Ø·¸¤Î¥Þ¥¯¥í¤Ï¾¤Ë¤â
-     @link Assertions ¥¢¥µ¡¼¥È¤ÎÀë¸À @endlink
-     ¤Ë¥ê¥¹¥È¤·¤Æ¤¢¤ê¤Þ¤¹¡£
+     ASSERT ´Ø·¸¤Î¥Þ¥¯¥í¤Ï¾¤Ë¤â@ref Assertions¤Ë¥ê¥¹¥È¤·¤Æ¤¢¤ê¤Þ¤¹¡£
      @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 (This sample program is in the @c examples/complex directory):
+For example, see the test of the library of the simple
+complex number as an example.
+(This sample program is in the @c examples/complex directory)
+To test whether the initialization of the complex numeber
+and tow complex numbers are equal.
 @~japanese
-Î㤨¤Ð¡¢´Êñ¤ÊÊ£ÁÇ¿ô¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Æ¥¹¥È¤¹¤ë¤³¤È¤òÎã¤Ë¤È¤Ã¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+Î㤨¤Ð¡¢´Êñ¤ÊÊ£ÁÇ¿ô¤Î¥é¥¤¥Ö¥é¥ê¤Î¥Æ¥¹¥È¤òÎã¤Ë¤È¤Ã¤Æ¤ß¤Þ¤·¤ç¤¦¡£
 ¡Ê¤³¤³¤Ç»ÈÍѤ¹¤ë@ref sample_programs¤Ï
-examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£¡Ë
+@c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£¡Ë
 Ê£ÁÇ¿ô¤ò½é´ü²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤¿¤«¤ò¥Æ¥¹¥È¤·¤¿¤ê¡¢
-Æó¤Ä¤ÎÊ£ÁÇ¿ô¤¬Åù¤·¤¤¤«¤ò¥Æ¥¹¥È¤¹¤ë¤È¤·¤Þ¤¹¡£
+Æó¤Ä¤ÎÊ£ÁÇ¿ô¤¬Åù¤·¤¤¤«¤ò¥Æ¥¹¥È¤·¤¿¤ê¤·¤Þ¤¹¡£
 @~
 
 @dontinclude complex/testComplex.c
@@ -104,55 +104,69 @@ examples/complex 
 @until }
 
 @english
+These two test functions are made one test case together,
+and we can run it.
 @japanese
 ¤³¤ÎÆó¤Ä¤Î¥Æ¥¹¥È´Ø¿ô¤ò¤Þ¤È¤á¤Æ¤Ò¤È¤Ä¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ë¤·¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
 @endif
 
 @dontinclude complex/runTestCase.c
 
-@skip CCUnitTestCase.h
-@until CCUnitTestResult.h
-
 @english
+Include the necessary header files.
 @japanese
 É¬ÍפʥإåÀ¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Þ¤¹¡£
 @endif
 
-@until main
-@until ccunit_newTestCase
+@skip CCUnitTestCase.h
+@until CCUnitTestResult.h
 
 @english
+First, Allocate the test case memory.
 @japanese
 ¤Þ¤º¥Æ¥¹¥È¥±¡¼¥¹¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
 @endif
 
-@until test_complex_equals);
+@until main
+@until ccunit_newTestCase
 
 @english
+Then, register the test functions in the test case.
+The assertion should specify the name of the function
+and the explanation of the function
+to indicate it at the unsuccessful time.
 @japanese
 ¤½¤·¤Æ¥Æ¥¹¥È¥±¡¼¥¹¤Ë¥Æ¥¹¥È´Ø¿ô¤òÅÐÏ¿¤·¤Þ¤¹¡£
 É½ÌÀ (ASSERT) ¤¬¼ºÇÔ¤·¤¿»þ¤Ëɽ¼¨¤¹¤ë¤¿¤á¤Î´Ø¿ô̾¤È´Ø¿ô¤ÎÀâÌÀ¤ò°ì½ï¤Ë»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£
 @endif
 
-@until wasSuccessful
+@until test_complex_equals);
 
 @english
+Run the test case, and take out the result.
 @japanese
 ¥Æ¥¹¥È¥±¡¼¥¹¤ò¼Â¹Ô¤·¡¢
 ·ë²Ì¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
 @endif
 
-@until }
+@until wasSuccessful
 
 @english
+Deallocate the memory whitch you assigned, 
+and return the result.
 @japanese
 ³ä¤êÅö¤Æ¤¿¥á¥â¥ê¤ò²òÊü¤·¡¢
 ·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£
 @endif
 
+@until }
+
 @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>.
+You find the sample code made in the above in the
+files <code>testComplex.c</code> and <code>runTestCase.c</code>
+in the <code>examples/complex</code> directory.
+
+To compile and run, do the following:
 @japanese
 ¤³¤³¤Þ¤Ç¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ï¡¢@c examples/complex ¥Ç¥£¥ì¥¯¥È¥ê¤Î
 <code>testComplex.c, runTestCase.c</code> ¤Ë¤¢¤ê¤Þ¤¹¡£
@@ -171,15 +185,13 @@ $ echo $?
 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.
+@ref ExecutingTest to display the results.
 @~japanese
 ¥Æ¥¹¥È¥±¡¼¥¹¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢
 »ØÄꤷ¤¿¥Æ¥¹¥È´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£
 ¤³¤ì¤Ï¤Þ¤À¤¢¤Þ¤êÊØÍø¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¢
 ¤Ê¤¼¤Ê¤é¡¢¿ÇÃǤ¬É½¼¨¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£
-Ä̾ï¤Ï @link ExecutingTest TestRunner @endlink
-¤Ç·ë²Ì¤òɽ¼¨¤·¤Þ¤¹¡£
+Ä̾ï¤Ï@ref ExecutingTest¤Ç·ë²Ì¤òɽ¼¨¤·¤Þ¤¹¡£
 @~
 
 @english