From 0425aadc78680e53000fd0108b540d6eca048516 Mon Sep 17 00:00:00 2001 From: gmcdonald Date: Sat, 13 Feb 2010 01:32:03 +0000 Subject: Moving axis svn, part of TLP move INFRA-2441 git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@909681 13f79535-47bb-0310-9956-ffa450edef68 --- util/test/utils/Makefile.am | 13 ++++++++++++ util/test/utils/build.sh | 3 +++ util/test/utils/utils_test.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 util/test/utils/Makefile.am create mode 100644 util/test/utils/build.sh create mode 100644 util/test/utils/utils_test.c (limited to 'util/test/utils') diff --git a/util/test/utils/Makefile.am b/util/test/utils/Makefile.am new file mode 100644 index 0000000..0fbcc8d --- /dev/null +++ b/util/test/utils/Makefile.am @@ -0,0 +1,13 @@ +TESTS = utils_test +check_PROGRAMS = utils_test +noinst_PROGRAMS = utils_test +utils_test_SOURCES = utils_test.c ../util/create_env.c + +utils_test_LDADD = \ + $(top_builddir)/src/libaxutil.la + +INCLUDES = -I$(top_builddir)/include \ + -I ../../../axiom/include \ + -I ../../../include + + diff --git a/util/test/utils/build.sh b/util/test/utils/build.sh new file mode 100644 index 0000000..09e7ef6 --- /dev/null +++ b/util/test/utils/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +gcc utils_test.c ../util/create_env.c -g -I$AXIS2C_HOME/include/axis2-1.2 -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -o utils_test diff --git a/util/test/utils/utils_test.c b/util/test/utils/utils_test.c new file mode 100644 index 0000000..2bbf67f --- /dev/null +++ b/util/test/utils/utils_test.c @@ -0,0 +1,47 @@ +#include "../util/create_env.h" +#include + +axutil_env_t *env = NULL; +axis2_char_t * request = "This is a requset"; +axis2_char_t * s = "This is a & '""xml string"; +axis2_char_t c = 'c'; + +/** @brief test utils + * test quote string + */ + +axis2_status_t test_utils() +{ + axis2_char_t **op, *quote_string; + int hexit; + env = create_environment(); + op = axutil_parse_request_url_for_svc_and_op(env,request); + quote_string = axutil_xml_quote_string(env,s,1); + printf("The quote string is%s\n",(char *)quote_string); + hexit = axutil_hexit(c); + printf("%d\n",hexit); + if(op && quote_string) + { + printf("The test is SUCCESS\n"); + } + if(!op || !quote_string) + { + printf("The test is FAIL"); + } + return AXIS2_SUCCESS; +} +int main() +{ + int status = AXIS2_SUCCESS; + env = create_environment(); + status = test_utils(); + if(status == AXIS2_FAILURE) + { + printf(" test failed"); + } + axutil_env_free(env); + return 0; +} + + + -- cgit v1.1-32-gdbae