OSDN Git Service

* Added test code of the <h4> tag for au XHTML converter.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:25:51 +0000 (12:25 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Mon, 14 Apr 2008 12:25:51 +0000 (12:25 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_11_0@2239 1a406e8e-add9-4483-a2c8-d8cac5b7c224

test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c

index 4a8e995..30ae3e4 100644 (file)
@@ -579,7 +579,9 @@ main()
   CU_add_test(xhtml_suite, "test <h3> with align attribute(right).",            test_xhtml_h3_tag_008);
   CU_add_test(xhtml_suite, "test <h3> with align attribute(center).",           test_xhtml_h3_tag_009);
   CU_add_test(xhtml_suite, "test <h3> with align attribute(unkown).",           test_xhtml_h3_tag_010);
-#if 0
+  /*=========================================================================*/
+  /* <h4>                                                                    */
+  /*=========================================================================*/
   CU_add_test(xhtml_suite, "test <h4>.",                                        test_xhtml_h4_tag_001);
   CU_add_test(xhtml_suite, "test <h4> with value.",                             test_xhtml_h4_tag_002);
   CU_add_test(xhtml_suite, "test <h4> with value(japanese).",                   test_xhtml_h4_tag_003);
@@ -590,6 +592,11 @@ main()
   CU_add_test(xhtml_suite, "test <h4> with align attribute(right).",            test_xhtml_h4_tag_008);
   CU_add_test(xhtml_suite, "test <h4> with align attribute(center).",           test_xhtml_h4_tag_009);
   CU_add_test(xhtml_suite, "test <h4> with align attribute(unkown).",           test_xhtml_h4_tag_010);
+
+  /*=========================================================================*/
+  /* <h5>                                                                    */
+  /*=========================================================================*/
+#if 0
   CU_add_test(xhtml_suite, "test <h5>.",                                        test_xhtml_h5_tag_001);
   CU_add_test(xhtml_suite, "test <h5> with value.",                             test_xhtml_h5_tag_002);
   CU_add_test(xhtml_suite, "test <h5> with value(japanese).",                   test_xhtml_h5_tag_003);
@@ -3974,11 +3981,10 @@ void test_xhtml_h3_tag_010()
 #undef TEST_STRING
 #undef RESULT_STRING
 }
-/* KONNO */
 void test_xhtml_h4_tag_001() 
 {
-#define  TEST_STRING "<html><head></head><body><h4></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4></h4></body></html>"
+#define  TEST_STRING "<h4></h4>"
+#define  RESULT_STRING "<h4></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -3995,6 +4001,7 @@ void test_xhtml_h4_tag_001()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4005,8 +4012,8 @@ void test_xhtml_h4_tag_001()
 }
 void test_xhtml_h4_tag_002() 
 {
-#define  TEST_STRING "<html><head></head><body><h4>abc</h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4>abc</h4></body></html>"
+#define  TEST_STRING "<h4>abc</h4>"
+#define  RESULT_STRING "<h4>abc</h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4023,6 +4030,7 @@ void test_xhtml_h4_tag_002()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4033,8 +4041,8 @@ void test_xhtml_h4_tag_002()
 }
 void test_xhtml_h4_tag_003() 
 {
-#define  TEST_STRING "<html><head></head><body><h4>亀さん</h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4>亀さん</h4></body></html>"
+#define  TEST_STRING "<h4>亀さん</h4>"
+#define  RESULT_STRING "<h4>亀さん</h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4051,6 +4059,7 @@ void test_xhtml_h4_tag_003()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4061,8 +4070,8 @@ void test_xhtml_h4_tag_003()
 }
 void test_xhtml_h4_tag_004() 
 {
-#define  TEST_STRING "<html><head></head><body><h4>ハンカク</h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4>ハンカク</h4></body></html>"
+#define  TEST_STRING "<h4>ハンカク</h4>"
+#define  RESULT_STRING "<h4>ハンカク</h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4079,6 +4088,7 @@ void test_xhtml_h4_tag_004()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4089,8 +4099,8 @@ void test_xhtml_h4_tag_004()
 }
 void test_xhtml_h4_tag_005() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4></h4></body></html>"
+#define  TEST_STRING "<h4 align></h4>"
+#define  RESULT_STRING "<h4></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4107,6 +4117,7 @@ void test_xhtml_h4_tag_005()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4117,8 +4128,8 @@ void test_xhtml_h4_tag_005()
 }
 void test_xhtml_h4_tag_006() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align=\"\"></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4></h4></body></html>"
+#define  TEST_STRING "<h4 align=\"\"></h4>"
+#define  RESULT_STRING "<h4></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4135,6 +4146,7 @@ void test_xhtml_h4_tag_006()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4145,8 +4157,8 @@ void test_xhtml_h4_tag_006()
 }
 void test_xhtml_h4_tag_007() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align=\"left\"></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4 align=\"left\"></h4></body></html>"
+#define  TEST_STRING "<h4 align=\"left\"></h4>"
+#define  RESULT_STRING "<h4 style=\"text-align:left\"></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4163,6 +4175,7 @@ void test_xhtml_h4_tag_007()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4173,8 +4186,8 @@ void test_xhtml_h4_tag_007()
 }
 void test_xhtml_h4_tag_008() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align=\"right\"></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4 align=\"right\"></h4></body></html>"
+#define  TEST_STRING "<h4 align=\"right\"></h4>"
+#define  RESULT_STRING "<h4 style=\"text-align:right\"></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4191,6 +4204,7 @@ void test_xhtml_h4_tag_008()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4201,8 +4215,8 @@ void test_xhtml_h4_tag_008()
 }
 void test_xhtml_h4_tag_009() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align=\"center\"></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4 align=\"center\"></h4></body></html>"
+#define  TEST_STRING "<h4 align=\"center\"></h4>"
+#define  RESULT_STRING "<h4 style=\"text-align:center\"></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4219,6 +4233,7 @@ void test_xhtml_h4_tag_009()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4229,8 +4244,8 @@ void test_xhtml_h4_tag_009()
 }
 void test_xhtml_h4_tag_010() 
 {
-#define  TEST_STRING "<html><head></head><body><h4 align=\"unkown\"></h4></body></html>"
-#define  RESULT_STRING "<html><head></head><body><h4></h4></body></html>"
+#define  TEST_STRING "<h4 align=\"unkown\"></h4>"
+#define  RESULT_STRING "<h4></h4>"
   char  *ret;
   char  *tmp;
   device_table spec;
@@ -4247,6 +4262,7 @@ void test_xhtml_h4_tag_010()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -4255,6 +4271,7 @@ void test_xhtml_h4_tag_010()
 #undef TEST_STRING
 #undef RESULT_STRING
 }
+/* KONNO */
 void test_xhtml_h5_tag_001() 
 {
 #define  TEST_STRING "<html><head></head><body><h5></h5></body></html>"