OSDN Git Service

insert figures of test case and fixture
authortsntsumi <tsntsumi@users.sourceforge.jp>
Wed, 18 Aug 2010 04:30:36 +0000 (04:30 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Wed, 18 Aug 2010 04:30:36 +0000 (04:30 +0000)
doc/cookbook.dox

index 77f74cc..983184a 100644 (file)
@@ -129,8 +129,23 @@ 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" ];
+    tcn [ label="Test case n" ];
+  }
+  gv -> tc1;
+  gv -> tcn;
+  tc1 -> tcn [ style=dotted, arrowtail=none ];
+}
+@enddot
 
 @~english
 Tests need to run against the background of a known set of
@@ -139,7 +154,7 @@ 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
-¥Æ¥¹¥È¤Ï¼þÃΤΥǡ¼¥¿¤Î¥»¥Ã¥È¤òÇطʤˤ·¤Æ¼Â¹Ô¤µ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+¥Æ¥¹¥È¤Ï¼þÃΤΥǡ¼¥¿¤Î½¸¤Þ¤ê¤òÇطʤˤ·¤Æ¼Â¹Ô¤µ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
 ¤³¤Î¥Ç¡¼¥¿¤Î¥»¥Ã¥È¤ò¥Õ¥£¥¯¥¹¥Á¥ã¤È¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡£
 ¥Æ¥¹¥È¤ò½ñ¤¤¤Æ¤¤¤ë¤È¡¢
 ¼ÂºÝ¤Î¥Æ¥¹¥È¤¹¤ëÃͤò¥Õ¥£¥¯¥¹¥Á¥ã¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¥³¡¼¥É¤ò½ñ¤¯Êý¤Ë¡¢
@@ -155,7 +170,7 @@ different results.
 Â¿¤¯¤Î¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤Î°Û¤Ê¤Ã¤¿¥Æ¥¹¥È¤Î¤¿¤á¤ËƱ¤¸¥Õ¥£¥¯¥¹¥Á¥ã¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
 ¤½¤ì¤¾¤ì¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Ï¾¯¤·°Û¤Ê¤Ã¤¿¥á¥Ã¥»¡¼¥¸¡¢
 ¤¢¤ë¤¤¤Ï¥Ñ¥é¥á¡¼¥¿¤ò¥Õ¥£¥¯¥¹¥Á¥ã¤ËÁ÷¤ê¡¢
-°Û¤Ê¤ë·ë²Ì¤òÄ´¤Ù¤Þ¤¹¡£
+°Û¤Ê¤ë·ë²Ì¤òÄ´¤Ù¤ë¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
 @~
 
 @~english
@@ -195,7 +210,7 @@ When you have a common fixture, here is what you do:
 <li>@~english
     Create a @link CCUnitTestFixture TestFixture @endlink object
     @~japanese
-    @link CCUnitTestFixture CCUnitTestFixture @endlink
+    @link CCUnitTestFixture TestFixture @endlink
     ¹½Â¤ÂΤ˥á¥â¥ê¤ò³ä¤êÅö¤Æ¤Þ¤¹
     @~
 </li>
@@ -209,6 +224,22 @@ When you have a common fixture, here is what you do:
 </li>
 </ol>
 
+@dot
+digraph TestFixture {
+  node [ fontsize=9, fontname=Helvetica ]
+  edge [ fontsize=9, dir=back, arrowtail=vee ]
+  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
 For example, to write several test cases, first create a
 fixture: