From ba523e0902799b068a0014b97ff39ee6ad49e97b Mon Sep 17 00:00:00 2001 From: konn Date: Sun, 5 Oct 2008 17:26:25 +0000 Subject: [PATCH] * Added test code of the chxjif tag for docomo XHTML1.0 converter. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/sandbox@3252 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- test/chxj_ixhtml10/test_chxj_ixhtml10.c | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/chxj_ixhtml10/test_chxj_ixhtml10.c b/test/chxj_ixhtml10/test_chxj_ixhtml10.c index 28f81b1c..4b727916 100644 --- a/test/chxj_ixhtml10/test_chxj_ixhtml10.c +++ b/test/chxj_ixhtml10/test_chxj_ixhtml10.c @@ -434,6 +434,7 @@ void test_ixhtml10_div_tag_007(); void test_ixhtml10_chxjif_tag_001(); void test_ixhtml10_chxjif_tag_002(); +void test_ixhtml10_chxjif_tag_003(); #if 0 @@ -1437,6 +1438,7 @@ main() /*=========================================================================*/ CU_add_test(ixhtml10_suite, "test .", test_ixhtml10_chxjif_tag_001); CU_add_test(ixhtml10_suite, "test 2.", test_ixhtml10_chxjif_tag_002); + CU_add_test(ixhtml10_suite, "test 3.", test_ixhtml10_chxjif_tag_003); #if 0 /*=========================================================================*/ /*
*/ @@ -31200,6 +31202,42 @@ void test_ixhtml10_chxjif_tag_002() #undef TEST_STRING #undef RESULT_STRING } +void test_ixhtml10_chxjif_tag_003() +{ +#define TEST_STRING "" \ + "" +#define RESULT_STRING "\n" \ + "" + char *ret; + char *tmp; + device_table spec; + chxjconvrule_entry entry; + cookie_t cookie; + apr_size_t destlen; + APR_INIT; + chxj_serf_get = test_chxj_serf_get_span020; + call_check = 0; + + COOKIE_INIT(cookie); + + SPEC_INIT(spec); + destlen = sizeof(TEST_STRING)-1; + entry.action |= CONVRULE_CSS_ON_BIT; + + tmp = chxj_encoding(&r, TEST_STRING, &destlen); + ret = chxj_convert_ixhtml10(&r, &spec, tmp, destlen, &destlen, &entry, &cookie); + ret = chxj_rencoding(&r, ret, &destlen); + fprintf(stderr, "actual:[%s]\n", ret); + fprintf(stderr, "expect:[%s]\n", TEST_RESULT); + CU_ASSERT(ret != NULL); + CU_ASSERT(strcmp(RESULT_STRING, ret) == 0); + CU_ASSERT(destlen == sizeof(RESULT_STRING)-1); + CU_ASSERT(call_check == 0); + + APR_TERM; +#undef TEST_STRING +#undef RESULT_STRING +} /* -- 2.11.0