You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by du...@apache.org on 2008/01/31 07:38:03 UTC

svn commit: r617016 - in /webservices/axis2/trunk/c/util/test/link_list: ./ build.sh link_list_test.c

Author: dushshantha
Date: Wed Jan 30 22:38:00 2008
New Revision: 617016

URL: http://svn.apache.org/viewvc?rev=617016&view=rev
Log: (empty)

Added:
    webservices/axis2/trunk/c/util/test/link_list/
    webservices/axis2/trunk/c/util/test/link_list/build.sh
    webservices/axis2/trunk/c/util/test/link_list/link_list_test.c

Added: webservices/axis2/trunk/c/util/test/link_list/build.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/link_list/build.sh?rev=617016&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/link_list/build.sh (added)
+++ webservices/axis2/trunk/c/util/test/link_list/build.sh Wed Jan 30 22:38:00 2008
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+gcc link_list_test.c ../util/create_env.c -g -I$AXIS2C_HOME/include/axis2-1.2 -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -o link_list_test 

Added: webservices/axis2/trunk/c/util/test/link_list/link_list_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/link_list/link_list_test.c?rev=617016&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/link_list/link_list_test.c (added)
+++ webservices/axis2/trunk/c/util/test/link_list/link_list_test.c Wed Jan 30 22:38:00 2008
@@ -0,0 +1,74 @@
+#include "../util/create_env.h"
+#include <axutil_linked_list.h>
+
+axutil_env_t *env = NULL;
+axutil_linked_list_t * linked_list = NULL;
+entry_t *entry = NULL;
+
+test_link_list(axutil_env_t *env,char * first_item,char * second_item,char * third_item,char *last_item,char *array)
+{ 
+    linked_list = axutil_linked_list_create(env);
+    if(linked_list)
+    {
+    printf("link list is created \n");
+    }
+    if(!linked_list)
+    {
+    printf("link list is not created ");
+    }
+    axutil_linked_list_add_first(linked_list,env,(void *)first_item);
+    axutil_linked_list_contains(linked_list,env,(void *)second_item);
+    axutil_linked_list_add(linked_list,env,(void *)third_item);
+    axutil_linked_list_add_last(linked_list,env,(void *)last_item);
+    int index_of_item = axutil_linked_list_index_of(linked_list,env,third_item);
+    printf("The index of item is %d\n",index_of_item);
+    int index_of_last_item = axutil_linked_list_last_index_of(linked_list,env,last_item);
+    entry_t * entry = axutil_linked_list_get_entry(linked_list,env,0);
+    printf("The index of last item is %d\n",index_of_last_item);
+    void *get_item = axutil_linked_list_get(linked_list,env,1);
+    printf("The get item is %s\n",(char *)get_item);
+    axutil_linked_list_set(linked_list,env,1,(void *)array);
+    axutil_linked_list_to_array(linked_list,env);
+    axutil_linked_list_add_at_index(linked_list,env,1,(void *)second_item);
+    axutil_linked_list_remove_at_index(linked_list,env,1);
+    axutil_linked_list_check_bounds_inclusive(linked_list,env,1);
+    axutil_linked_list_remove_entry(linked_list,env,entry);
+    axutil_linked_list_remove_first(linked_list,env);
+    axutil_linked_list_remove_last(linked_list,env);
+    axutil_linked_list_remove(linked_list,env,(void *)third_item);
+    axutil_linked_list_free(linked_list,env);
+    if(index_of_item && index_of_last_item &&  get_item)
+    {
+    printf("The test is SUCCESS\n");
+    }
+    if(!index_of_item || !index_of_last_item || !get_item)
+    {
+    printf("The test is FAIL\n");
+    }
+    return AXIS2_SUCCESS;
+}
+
+int main()
+{
+    int status = AXIS2_SUCCESS;
+    char * first_item;
+    char * second_item;
+    char * third_item;
+    char * last_item;
+    char * array;
+    env = create_environment();
+    status = test_link_list(env,"first entry","secnd entry","third entry","last entry" ,"test");
+    if(status == AXIS2_FAILURE)
+    {
+        printf(" build  failed");
+    }
+    axutil_env_free(env);
+    return 0;
+}
+
+
+
+
+
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org