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 da...@apache.org on 2005/12/06 04:40:02 UTC
svn commit: r354275 - in /webservices/axis2/trunk/c: ./ bindings/php/axis2/
conftools/ modules/ modules/common/ modules/common/src/
modules/common/test/ modules/core/ modules/core/addr/
modules/core/addr/src/ modules/core/context/ modules/core/context/...
Author: damitha
Date: Mon Dec 5 19:36:58 2005
New Revision: 354275
URL: http://svn.apache.org/viewcvs?rev=354275&view=rev
Log:
Removed generated build files from the svn, following the
discussion regarding this in mailing list
Removed:
webservices/axis2/trunk/c/Makefile.in
webservices/axis2/trunk/c/acinclude.m4
webservices/axis2/trunk/c/bindings/php/axis2/config.m4
webservices/axis2/trunk/c/configure
webservices/axis2/trunk/c/conftools/ac_c_bigendian_cross.m4
webservices/axis2/trunk/c/conftools/config.guess
webservices/axis2/trunk/c/conftools/config.sub
webservices/axis2/trunk/c/conftools/depcomp
webservices/axis2/trunk/c/conftools/install-sh
webservices/axis2/trunk/c/conftools/libtool.m4
webservices/axis2/trunk/c/conftools/ltmain.sh
webservices/axis2/trunk/c/conftools/missing
webservices/axis2/trunk/c/modules/Makefile.in
webservices/axis2/trunk/c/modules/common/Makefile.in
webservices/axis2/trunk/c/modules/common/src/Makefile.in
webservices/axis2/trunk/c/modules/common/test/Makefile.in
webservices/axis2/trunk/c/modules/core/Makefile.in
webservices/axis2/trunk/c/modules/core/addr/Makefile.in
webservices/axis2/trunk/c/modules/core/addr/src/Makefile.in
webservices/axis2/trunk/c/modules/core/context/Makefile.in
webservices/axis2/trunk/c/modules/core/context/src/Makefile.in
webservices/axis2/trunk/c/modules/core/context/test/Makefile.in
webservices/axis2/trunk/c/modules/core/deployment/Makefile.in
webservices/axis2/trunk/c/modules/core/deployment/src/Makefile.in
webservices/axis2/trunk/c/modules/core/description/Makefile.in
webservices/axis2/trunk/c/modules/core/description/src/Makefile.in
webservices/axis2/trunk/c/modules/core/description/test/Makefile.in
webservices/axis2/trunk/c/modules/core/engine/Makefile.in
webservices/axis2/trunk/c/modules/core/engine/src/Makefile.in
webservices/axis2/trunk/c/modules/core/engine/test/Makefile.in
webservices/axis2/trunk/c/modules/core/handlers/Makefile.in
webservices/axis2/trunk/c/modules/core/handlers/src/Makefile.in
webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.in
webservices/axis2/trunk/c/modules/core/phaseresolver/src/Makefile.in
webservices/axis2/trunk/c/modules/core/transport/Makefile.in
webservices/axis2/trunk/c/modules/util/Makefile.in
webservices/axis2/trunk/c/modules/util/src/Makefile.in
webservices/axis2/trunk/c/modules/util/test/Makefile.in
webservices/axis2/trunk/c/modules/wsdl/Makefile.in
webservices/axis2/trunk/c/modules/wsdl/src/Makefile.in
webservices/axis2/trunk/c/modules/wsdl/test/Makefile.in
webservices/axis2/trunk/c/modules/xml/Makefile.in
webservices/axis2/trunk/c/modules/xml/om/Makefile.in
webservices/axis2/trunk/c/modules/xml/om/src/Makefile.in
webservices/axis2/trunk/c/modules/xml/om/test/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/guththila/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/guththila/src/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/guththila/test/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/libxml2/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/Makefile.in
webservices/axis2/trunk/c/modules/xml/parser/libxml2/test/Makefile.in
webservices/axis2/trunk/c/modules/xml/soap/Makefile.in
webservices/axis2/trunk/c/modules/xml/soap/src/Makefile.in
webservices/axis2/trunk/c/test/Makefile.in
webservices/axis2/trunk/c/test/common/Makefile.in
webservices/axis2/trunk/c/test/core/Makefile.in
webservices/axis2/trunk/c/test/core/handlers/Makefile.in
webservices/axis2/trunk/c/test/unit/Makefile.in
webservices/axis2/trunk/c/test/unit/core/Makefile.in
webservices/axis2/trunk/c/test/unit/core/context/Makefile.in
webservices/axis2/trunk/c/test/unit/core/description/Makefile.in
webservices/axis2/trunk/c/test/unit/core/engine/Makefile.in
webservices/axis2/trunk/c/test/unit/core/phaseresolver/Makefile.in
webservices/axis2/trunk/c/test/unit/util/Makefile.in
webservices/axis2/trunk/c/test/unit/xml/Makefile.in
webservices/axis2/trunk/c/test/unit/xml/om/Makefile.in
webservices/axis2/trunk/c/test/util/Makefile.in
webservices/axis2/trunk/c/test/xml/Makefile.in
webservices/axis2/trunk/c/test/xml/om/Makefile.in
Modified:
webservices/axis2/trunk/c/test/unit/util/util_hash_test.c
webservices/axis2/trunk/c/test/unit/util/util_hash_test.h
webservices/axis2/trunk/c/test/unit/util/util_test.c
webservices/axis2/trunk/c/test/util/test_util.c
Modified: webservices/axis2/trunk/c/test/unit/util/util_hash_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/util/util_hash_test.c?rev=354275&r1=354274&r2=354275&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/util/util_hash_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/util/util_hash_test.c Mon Dec 5 19:36:58 2005
@@ -39,3 +39,80 @@
expected = (a *) axis2_hash_get (ht, key1, AXIS2_HASH_KEY_STRING);
CuAssertStrEquals(tc, expected->value, actual->value);
}
+
+void Testaxis2_hash_while(CuTest *tc)
+{
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *environment =
+ axis2_env_create (allocator);
+
+ axis2_hash_t *ht;
+ a *actual = NULL;
+ a *expected = NULL;
+ a *entry1 = NULL;
+ a *entry2 = NULL;
+ a *entry3 = NULL;
+
+ axis2_hash_index_t *index_i= 0;
+ void *v = NULL;
+ void *k = NULL;
+
+ char *key = NULL;
+ char *key1 = "key1";
+ char *key2 = "key2";
+ char *key3 = "key3";
+
+ entry1 = (a *) AXIS2_MALLOC(environment->allocator, sizeof (a));
+ entry2 = (a *) AXIS2_MALLOC(environment->allocator, sizeof (a));
+ entry3 = (a *) AXIS2_MALLOC(environment->allocator, sizeof (a));
+
+ expected = (a *) AXIS2_MALLOC(environment->allocator, sizeof (a));
+ expected->value = AXIS2_STRDUP("value2", &environment);
+
+ entry1->value = AXIS2_STRDUP("value1", &environment);
+
+ ht = axis2_hash_make (&environment);
+
+ axis2_hash_set (ht, key1, AXIS2_HASH_KEY_STRING, entry1);
+
+ entry2->value = AXIS2_STRDUP("value2", &environment);
+
+ axis2_hash_set (ht, key2, AXIS2_HASH_KEY_STRING, entry2);
+
+ entry3->value = AXIS2_STRDUP("value3", &environment);
+
+ axis2_hash_set (ht, key3, AXIS2_HASH_KEY_STRING, entry3);
+
+ index_i = axis2_hash_first (ht, &environment);
+ do
+ {
+ axis2_hash_this (index_i, &k, NULL, &v);
+ key = (char *) k;
+ if(0 == AXIS2_STRCMP(key, "key2"))
+ {
+ actual = (a *) v;
+ break;
+ }
+ index_i = axis2_hash_next (&environment, index_i);
+ }while(NULL != index_i);
+ printf("actual:%s\n", actual->value);
+ CuAssertStrEquals(tc, expected->value, actual->value);
+ free(expected->value);
+ free(expected);
+
+ free(entry1->value);
+ free(entry1);
+ free(entry3->value);
+ free(entry3);
+ free(entry2->value);
+ free(entry2);
+ axis2_hash_free(ht, &environment);
+
+
+
+
+
+
+
+
+}
Modified: webservices/axis2/trunk/c/test/unit/util/util_hash_test.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/util/util_hash_test.h?rev=354275&r1=354274&r2=354275&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/util/util_hash_test.h (original)
+++ webservices/axis2/trunk/c/test/unit/util/util_hash_test.h Mon Dec 5 19:36:58 2005
@@ -10,5 +10,6 @@
#include <axis2_string.h>
void Testaxis2_hash_get(CuTest *tc);
+void Testaxis2_hash_while(CuTest *tc);
#endif /* UTIL_HASH_TEST_H*/
Modified: webservices/axis2/trunk/c/test/unit/util/util_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/util/util_test.c?rev=354275&r1=354274&r2=354275&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/util/util_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/util/util_test.c Mon Dec 5 19:36:58 2005
@@ -10,8 +10,8 @@
SUITE_ADD_TEST(suite, Testaxis2_stream_write);
SUITE_ADD_TEST(suite, Testaxis2_log_write);
SUITE_ADD_TEST(suite, Testaxis2_hash_get);
+ SUITE_ADD_TEST(suite, Testaxis2_hash_while);
SUITE_ADD_TEST(suite, Testaxis2_array_list_get);
SUITE_ADD_TEST(suite, Testaxis2_linked_list_get);
return suite;
}
-
Modified: webservices/axis2/trunk/c/test/util/test_util.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/util/test_util.c?rev=354275&r1=354274&r2=354275&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/util/test_util.c (original)
+++ webservices/axis2/trunk/c/test/util/test_util.c Mon Dec 5 19:36:58 2005
@@ -20,6 +20,8 @@
#include <axis2_file_diff.h>
#include <axis2_error_default.h>
#include <axis2_stream_default.h>
+#include <axis2_array_list.h>
+#include <string.h>
typedef struct a
{
@@ -107,28 +109,38 @@
{
if(NULL == *env)
{
+ puts("came3\n");
axis2_allocator_t *allocator = axis2_allocator_init (NULL);
axis2_error_t *error = axis2_error_create (allocator);
+ puts("came4\n");
axis2_stream_t *stream = axis2_stream_create (allocator, NULL);
*env = axis2_env_create_with_error_stream (allocator, error, stream);
+ puts("came5\n");
AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE);
- AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_ENVIRONMENT_IS_NULL);
+ puts("came6\n");
+ AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_ENVIRONMENT_IS_NULL);
+ puts("came7\n");
return NULL;
}
+
+ AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_SUCCESS);
return "env not null, so be happy";
}
int test_env_null()
{
- axis2_env_t *env;
+ axis2_env_t *env = NULL;
/* Suppose we did properly initialized env here */
/* But here we mistakenly make env to null */
env = NULL;
/*Now we call an axis2 mock function called
* test_funct_for_test_env_null
*/
- char *msg = test_funct_for_test_env_null(&env);
+ puts("came1\n");
+ char *msg = strdup(test_funct_for_test_env_null(&env));
+ puts("came2\n");
int status = axis2_env_check_status(&env);
+ printf("status:%d\n", status);
if(AXIS2_SUCCESS == status)
printf("%s\n", msg);
else
@@ -136,12 +148,52 @@
return 0;
}
+void test_array_list(axis2_env_t *env)
+{
+ axis2_array_list_t *al;
+ a *entry = NULL;
+
+
+ al = axis2_array_list_create (&env, 10);
+
+ entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+ entry->value = AXIS2_STRDUP("value1", &env);
+ AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+ entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+ entry->value = AXIS2_STRDUP("value2", &env);
+ AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+ entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+ entry->value = AXIS2_STRDUP("value3", &env);
+ AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+ entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+ entry->value = AXIS2_STRDUP("value4", &env);
+ AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+ entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+ entry->value = AXIS2_STRDUP("value5", &env);
+ AXIS2_ARRAY_LIST_SET (al, &env, 3, (void*)entry);
+ AXIS2_ARRAY_LIST_REMOVE (al, &env, 2);
+
+ entry = (a *) AXIS2_ARRAY_LIST_GET (al, &env, 0);
+ printf("entry->value:%s\n", entry->value);
+
+ entry = (a *) AXIS2_ARRAY_LIST_GET (al, &env, 2);
+ printf("entry->value:%s\n", entry->value);
+
+}
+
+
+
int main(void)
{
axis2_env_t *env = test_init();
test_file_diff(env);
test_hash_get(env);
- test_env_null();
+ test_env_null();
+ test_array_list(env);
return 0;
}