OSDN Git Service

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

test/chxj_hdml/test_chxj_hdml.c

index fc6fd09..0ed5db8 100644 (file)
@@ -319,6 +319,9 @@ void test_hdml_li_tag_010();
 void test_hdml_li_tag_011();
 void test_hdml_li_tag_012();
 void test_hdml_li_tag_013();
+void test_hdml_li_tag_014();
+void test_hdml_li_tag_015();
+void test_hdml_li_tag_016();
 
 void test_hdml_menu_tag_001();
 void test_hdml_menu_tag_002();
@@ -770,6 +773,9 @@ main()
   CU_add_test(hdml_suite, "test <li> type attribute 7." ,                      test_hdml_li_tag_011);
   CU_add_test(hdml_suite, "test <li> type attribute 8." ,                      test_hdml_li_tag_012);
   CU_add_test(hdml_suite, "test <li> type attribute 9." ,                      test_hdml_li_tag_013);
+  CU_add_test(hdml_suite, "test <li> type attribute 10." ,                     test_hdml_li_tag_014);
+  CU_add_test(hdml_suite, "test <li> type attribute 11." ,                     test_hdml_li_tag_015);
+  CU_add_test(hdml_suite, "test <li> type attribute 12." ,                     test_hdml_li_tag_016);
 
   /*=========================================================================*/
   /* <menu>                                                                  */
@@ -9165,6 +9171,96 @@ void test_hdml_li_tag_013()
 #undef TEST_STRING
 #undef RESULT_STRING
 }
+void test_hdml_li_tag_014() 
+{
+#define  TEST_STRING "<li type=\"disc\">ハンカク</li>"
+#define  RESULT_STRING "<BR>\r\n<WRAP>ハンカク<BR>\r\n"
+  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_hdml(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "actual=[%s]\n", ret);
+  fprintf(stderr, "except=[%s]\n", RESULT_STRING);
+  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_hdml_li_tag_015() 
+{
+#define  TEST_STRING "<li type=\"circle\">ハンカク</li>"
+#define  RESULT_STRING "<BR>\r\n<WRAP>ハンカク<BR>\r\n"
+  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_hdml(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "actual=[%s]\n", ret);
+  fprintf(stderr, "except=[%s]\n", RESULT_STRING);
+  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_hdml_li_tag_016() 
+{
+#define  TEST_STRING "<li type=\"square\">ハンカク</li>"
+#define  RESULT_STRING "<BR>\r\n<WRAP>ハンカク<BR>\r\n"
+  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_hdml(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "actual=[%s]\n", ret);
+  fprintf(stderr, "except=[%s]\n", RESULT_STRING);
+  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>                                                                     */
 /*============================================================================*/