summaryrefslogtreecommitdiffstats
path: root/util/test/utils/utils_test.c
blob: 2bbf67f96915fb3015a26c8a33e4a2847f9b1f85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "../util/create_env.h"
#include <axutil_utils.h>

axutil_env_t *env = NULL;
axis2_char_t * request = "This is a requset";
axis2_char_t * s = "<root>This is a & '""xml string</root>";
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;
}