axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r412083 - in /webservices/axis2/trunk/c/util/test/unit/util: Makefile.am util_dir_handler_test.c util_hash_test.c util_string_test.c util_string_test.h util_test.c util_test.h util_url_test.c util_url_test.h
Date Tue, 06 Jun 2006 11:15:11 GMT
Author: damitha
Date: Tue Jun  6 04:15:10 2006
New Revision: 412083

URL: http://svn.apache.org/viewvc?rev=412083&view=rev
Log:
Added new tests

Added:
    webservices/axis2/trunk/c/util/test/unit/util/util_string_test.c
    webservices/axis2/trunk/c/util/test/unit/util/util_string_test.h
    webservices/axis2/trunk/c/util/test/unit/util/util_url_test.c
    webservices/axis2/trunk/c/util/test/unit/util/util_url_test.h
Modified:
    webservices/axis2/trunk/c/util/test/unit/util/Makefile.am
    webservices/axis2/trunk/c/util/test/unit/util/util_dir_handler_test.c
    webservices/axis2/trunk/c/util/test/unit/util/util_hash_test.c
    webservices/axis2/trunk/c/util/test/unit/util/util_test.c
    webservices/axis2/trunk/c/util/test/unit/util/util_test.h

Modified: webservices/axis2/trunk/c/util/test/unit/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/Makefile.am?rev=412083&r1=412082&r2=412083&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/util/test/unit/util/Makefile.am Tue Jun  6 04:15:10 2006
@@ -3,7 +3,8 @@
 prglibdir=$(prefix)/lib/unit_test
 prglib_LTLIBRARIES = libtest_util.la
 
-libtest_util_la_SOURCES = util_hash_test.c \
+libtest_util_la_SOURCES = \
+						  	util_hash_test.c \
                             util_stream_test.c \
                             util_log_test.c \
                             util_error_test.c \
@@ -11,7 +12,9 @@
                             util_array_list_test.c\
                             util_linked_list_test.c \
                             util_dir_handler_test.c \
-                            util_class_loader_test.c
+                            util_class_loader_test.c \
+                            util_string_test.c \
+                            util_url_test.c
 
 noinst_HEADERS=$(top_builddir)/test/unit/util/*.h
 

Modified: webservices/axis2/trunk/c/util/test/unit/util/util_dir_handler_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_dir_handler_test.c?rev=412083&r1=412082&r2=412083&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_dir_handler_test.c (original)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_dir_handler_test.c Tue Jun  6 04:15:10
2006
@@ -7,7 +7,7 @@
    axis2_char_t *pathname = NULL;
     axis2_array_list_t *file_list = NULL;
     int size = 0;
-    axis2_char_t *expected = NULL;
+    const axis2_char_t *expected = NULL;
     axis2_char_t *actual = NULL;
     int i = 0;
     axis2_char_t *axis2c_home = NULL;
@@ -26,6 +26,8 @@
     size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
     for (i = 0; i < size; i++) 
     {
+        const axis2_char_t *name = NULL;
+        
         axis2_file_t *arch_file = NULL;
         arch_file = (axis2_file_t *) AXIS2_ARRAY_LIST_GET(file_list, env, i);
         if(!arch_file)
@@ -33,7 +35,8 @@
             printf("arch file is null\n");
             continue;
         }
-        if(0 == AXIS2_STRCMP(AXIS2_FILE_GET_NAME(arch_file, env), expected))
+        name = AXIS2_FILE_GET_NAME(arch_file, env);
+        if(0 == AXIS2_STRCMP(name, expected))
         {
             actual = AXIS2_FILE_GET_NAME(arch_file, env);
         }   

Modified: webservices/axis2/trunk/c/util/test/unit/util/util_hash_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_hash_test.c?rev=412083&r1=412082&r2=412083&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_hash_test.c (original)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_hash_test.c Tue Jun  6 04:15:10 2006
@@ -58,7 +58,7 @@
     void *v = NULL;
     const void *k = NULL;
 
-    char *key = NULL;
+    const char *key = NULL;
     char *key1 = "key1";
     char *key2 = "key2";
     char *key3 = "key3";
@@ -87,11 +87,13 @@
     index_i = axis2_hash_first (ht, environment);
     do 
     {
+        const char *key2 = "key2";
+
         axis2_hash_this (index_i, &k, NULL, &v);
         
         key = (char *)k;
         
-        if(0 == AXIS2_STRCMP(key, "key2"))
+        if(0 == AXIS2_STRCMP(key, key2))
         {
             actual = (a *) v;
             break;

Added: webservices/axis2/trunk/c/util/test/unit/util/util_string_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_string_test.c?rev=412083&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_string_test.c (added)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_string_test.c Tue Jun  6 04:15:10 2006
@@ -0,0 +1,25 @@
+#include "util_string_test.h"
+#include <axis2_env.h>
+#include <axis2_error_default.h>
+#include <axis2_log_default.h>
+#include <stdlib.h>
+
+void Testaxis2_strndup(CuTest *tc) 
+{
+    axis2_char_t *actual = NULL;
+    int n = 3;
+    axis2_char_t *expected = "dam";
+    
+    printf("******************************************\n");
+    printf("testing axis2_strndup\n");
+    printf("******************************************\n");
+    
+    axis2_allocator_t *allocator = axis2_allocator_init(NULL);
+    axis2_error_t *error = axis2_error_create(allocator);
+    const axis2_env_t *env = axis2_env_create_with_error(allocator, error);
+
+    actual = axis2_strndup("damitha", n, env);
+    printf("actual:%s\n", actual);
+
+    CuAssertStrEquals(tc, expected, actual);
+}

Added: webservices/axis2/trunk/c/util/test/unit/util/util_string_test.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_string_test.h?rev=412083&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_string_test.h (added)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_string_test.h Tue Jun  6 04:15:10 2006
@@ -0,0 +1,9 @@
+#ifndef UTIL_STRING_TEST_H
+#define UTIL_STRING_TEST_H
+
+#undef NULL
+#include <CuTest.h>
+
+void Testaxis2_strndup(CuTest *tc);
+
+#endif /* UTIL_STRING_TEST_H*/

Modified: webservices/axis2/trunk/c/util/test/unit/util/util_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_test.c?rev=412083&r1=412082&r2=412083&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_test.c (original)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_test.c Tue Jun  6 04:15:10 2006
@@ -16,6 +16,8 @@
     SUITE_ADD_TEST(suite, Testaxis2_hash_while);
     SUITE_ADD_TEST(suite, Testaxis2_array_list_get);
     SUITE_ADD_TEST(suite, Testaxis2_linked_list_get);
+    SUITE_ADD_TEST(suite, Testaxis2_strndup);
+    SUITE_ADD_TEST(suite, Testaxis2_url_parse_string);
     /* Samisa - need to remove this as we run make check before make install
     SUITE_ADD_TEST(suite, Testaxis2_dir_handler_list_dir); */
     return suite;

Modified: webservices/axis2/trunk/c/util/test/unit/util/util_test.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_test.h?rev=412083&r1=412082&r2=412083&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_test.h (original)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_test.h Tue Jun  6 04:15:10 2006
@@ -10,6 +10,8 @@
 #include "util_error_test.h"
 #include "util_dir_handler_test.h"
 #include "util_class_loader_test.h"
+#include "util_url_test.h"
+#include "util_string_test.h"
 
 CuSuite* axis2_utilGetSuite();
 

Added: webservices/axis2/trunk/c/util/test/unit/util/util_url_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_url_test.c?rev=412083&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_url_test.c (added)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_url_test.c Tue Jun  6 04:15:10 2006
@@ -0,0 +1,27 @@
+#include "util_class_loader_test.h"
+#include <axis2_url.h>
+#include <axis2_utils.h>
+#include <axis2_string.h>
+#include <stdio.h>
+
+void Testaxis2_url_parse_string(CuTest *tc)
+{
+    axis2_char_t *actual = NULL;
+    axis2_char_t *expected = NULL;
+    axis2_url_t *url = NULL;
+    axis2_char_t *url_str = NULL;
+
+    printf("******************************************\n");
+    printf("testing axis2_url_parse_string\n");
+    printf("******************************************\n");
+    axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+    const axis2_env_t *env = axis2_env_create (allocator);
+   
+    url_str = AXIS2_STRDUP("file://home/damitha/temp/checkout.sh", env);
+    url = axis2_url_parse_string(env, url_str);
+   
+    actual = AXIS2_URL_TO_EXTERNAL_FORM(url, env);
+    printf("actual:%s\n", actual);
+    
+    CuAssertStrEquals(tc, expected, actual);
+}

Added: webservices/axis2/trunk/c/util/test/unit/util/util_url_test.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/unit/util/util_url_test.h?rev=412083&view=auto
==============================================================================
--- webservices/axis2/trunk/c/util/test/unit/util/util_url_test.h (added)
+++ webservices/axis2/trunk/c/util/test/unit/util/util_url_test.h Tue Jun  6 04:15:10 2006
@@ -0,0 +1,9 @@
+#ifndef UTIL_URL_TEST_H
+#define UTIL_URL_TEST_H
+
+#undef NULL
+#include <CuTest.h>
+
+void Testaxis2_url_parse_string(CuTest *tc);
+
+#endif /* UTIL_URL_TEST_H*/



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


Mime
View raw message