void test_chtml20_a_tag_accesskey_attribute_001();
void test_chtml20_a_tag_accesskey_attribute_002();
void test_chtml20_a_tag_accesskey_attribute_003();
+
+void test_chtml20_base_tag_001();
+void test_chtml20_base_tag_href_attribute_001();
+void test_chtml20_base_tag_href_attribute_002();
+void test_chtml20_base_tag_href_attribute_003();
+void test_chtml20_base_tag_href_attribute_004();
/* pend */
int
CU_add_test(chtml20_suite, "test a tag accesskey attribute.", test_chtml20_a_tag_accesskey_attribute_001);
CU_add_test(chtml20_suite, "test a tag accesskey attribute with void char.", test_chtml20_a_tag_accesskey_attribute_002);
CU_add_test(chtml20_suite, "test a tag accesskey attribute with no value", test_chtml20_a_tag_accesskey_attribute_003);
+
+ CU_add_test(chtml20_suite, "test base tag no attribute.", test_chtml20_base_tag_001);
+ CU_add_test(chtml20_suite, "test base tag href attribute with no value.", test_chtml20_base_tag_href_attribute_001);
+ CU_add_test(chtml20_suite, "test base tag href attribute with void value.", test_chtml20_base_tag_href_attribute_002);
+ CU_add_test(chtml20_suite, "test base tag href attribute with normal value.", test_chtml20_base_tag_href_attribute_003);
+ CU_add_test(chtml20_suite, "test base tag href attribute with normal value.", test_chtml20_base_tag_href_attribute_004);
/* aend */
CU_basic_run_tests();
#undef TEST_STRING
#undef RESULT_STRING
}
+/*============================================================================*/
+/* <BASE> */
+/*============================================================================*/
+void test_chtml20_base_tag_001()
+{
+#define TEST_STRING "<html><head><base></head><body></body></html>"
+#define RESULT_STRING "<html><head><base></head><body></body></html>"
+ 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_exchange_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_base_tag_href_attribute_001()
+{
+#define TEST_STRING "<html><head><base href></head><body></body></html>"
+#define RESULT_STRING "<html><head><base href=\"\"></head><body></body></html>"
+ 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_exchange_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_base_tag_href_attribute_002()
+{
+#define TEST_STRING "<html><head><base href=\"\"></head><body></body></html>"
+#define RESULT_STRING "<html><head><base href=\"\"></head><body></body></html>"
+ 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_exchange_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_base_tag_href_attribute_003()
+{
+#define TEST_STRING "<html><head><base href=\"http://www.google.co.jp/\"></head><body></body></html>"
+#define RESULT_STRING "<html><head><base href=\"http://www.google.co.jp/\"></head><body></body></html>"
+ 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_exchange_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_base_tag_href_attribute_004()
+{
+#define TEST_STRING "<html><head><base href=\".\"></head><body></body></html>"
+#define RESULT_STRING "<html><head><base href=\".\"></head><body></body></html>"
+ 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_exchange_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
+}
/*
* vim:ts=2 et
*/