OSDN Git Service

* Added test code of the <li type> attribute for CHTML2.0 converter.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sat, 26 Apr 2008 08:28:54 +0000 (08:28 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sat, 26 Apr 2008 08:28:54 +0000 (08:28 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_12_0@2525 1a406e8e-add9-4483-a2c8-d8cac5b7c224

test/chxj_chtml20/test_chxj_chtml20.c

index fe54890..18b93a8 100644 (file)
@@ -314,6 +314,11 @@ void test_chtml20_li_tag_010();
 void test_chtml20_li_tag_011();
 void test_chtml20_li_tag_012();
 void test_chtml20_li_tag_013();
+void test_chtml20_li_tag_014();
+void test_chtml20_li_tag_015();
+void test_chtml20_li_tag_016();
+void test_chtml20_li_tag_017();
+void test_chtml20_li_tag_018();
 
 void test_chtml20_menu_tag_001();
 void test_chtml20_menu_tag_002();
@@ -738,6 +743,11 @@ main()
   CU_add_test(chtml20_suite, "test <li> type attribute 7." ,                      test_chtml20_li_tag_011);
   CU_add_test(chtml20_suite, "test <li> type attribute 8." ,                      test_chtml20_li_tag_012);
   CU_add_test(chtml20_suite, "test <li> type attribute 9." ,                      test_chtml20_li_tag_013);
+  CU_add_test(chtml20_suite, "test <li> type attribute 10." ,                     test_chtml20_li_tag_014);
+  CU_add_test(chtml20_suite, "test <li> type attribute 11." ,                     test_chtml20_li_tag_015);
+  CU_add_test(chtml20_suite, "test <li> type attribute 12." ,                     test_chtml20_li_tag_016);
+  CU_add_test(chtml20_suite, "test <li> type attribute 13." ,                     test_chtml20_li_tag_017);
+  CU_add_test(chtml20_suite, "test <li> type attribute 14." ,                     test_chtml20_li_tag_018);
 
   CU_add_test(chtml20_suite, "test <menu>." ,                                     test_chtml20_menu_tag_001);
   CU_add_test(chtml20_suite, "test <menu> 2." ,                                   test_chtml20_menu_tag_002);
@@ -8100,6 +8110,146 @@ void test_chtml20_li_tag_013()
 #undef TEST_STRING
 #undef RESULT_STRING
 }
+void test_chtml20_li_tag_014() 
+{
+#define  TEST_STRING "<li type=\"disc\">ハンカク</li>"
+#define  RESULT_STRING "<li>ハンカク"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_chtml20(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_chtml20_li_tag_015() 
+{
+#define  TEST_STRING "<li type=\"circle\">ハンカク</li>"
+#define  RESULT_STRING "<li>ハンカク"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_chtml20(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_chtml20_li_tag_016() 
+{
+#define  TEST_STRING "<li type=\"square\">ハンカク</li>"
+#define  RESULT_STRING "<li>ハンカク"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_chtml20(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_chtml20_li_tag_017() 
+{
+#define  TEST_STRING "<li type=\"\">ハンカク</li>"
+#define  RESULT_STRING "<li>ハンカク"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_chtml20(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_chtml20_li_tag_018() 
+{
+#define  TEST_STRING "<li type>ハンカク</li>"
+#define  RESULT_STRING "<li>ハンカク"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_chtml20(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
 /*============================================================================*/
 /* <MENU>                                                                     */
 /*============================================================================*/