From: konn Date: Sun, 27 Apr 2008 15:28:55 +0000 (+0000) Subject: * Added test code of the attribute for au HDML converter. X-Git-Tag: v0.12.20~248 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b1dd5bc1da206577b4f07741f1734258a6e5c4a1;p=modchxj%2Fmod_chxj.git * Added test code of the attribute for au HDML converter. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_12_0@2555 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- diff --git a/test/chxj_hdml/test_chxj_hdml.c b/test/chxj_hdml/test_chxj_hdml.c index 3f0bdac5..b289dd10 100644 --- a/test/chxj_hdml/test_chxj_hdml.c +++ b/test/chxj_hdml/test_chxj_hdml.c @@ -412,6 +412,7 @@ void test_hdml_marquee_tag_004(); void test_hdml_meta_tag_001(); void test_hdml_font_tag_001(); +void test_hdml_font_tag_002(); void test_hdml_param_tag_001(); /* pend */ @@ -884,6 +885,7 @@ main() /* */ /*=========================================================================*/ CU_add_test(hdml_suite, "test 1." , test_hdml_font_tag_001); + CU_add_test(hdml_suite, "test 2." , test_hdml_font_tag_002); /*=========================================================================*/ /* */ @@ -10927,6 +10929,36 @@ void test_hdml_font_tag_001() #undef TEST_STRING #undef RESULT_STRING } +void test_hdml_font_tag_002() +{ +#define TEST_STRING "あああ" +#define RESULT_STRING "あああ" + 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 +} /*============================================================================*/ /* */ /*============================================================================*/