axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r345848 - in /webservices/axis2/trunk/c/modules/xml: om/src/ om/test/ parser/ parser/guththila/impl/src/ parser/guththila/src/ parser/libxml2/src/
Date Mon, 21 Nov 2005 06:17:24 GMT
Author: samisa
Date: Sun Nov 20 22:17:08 2005
New Revision: 345848

URL: http://svn.apache.org/viewcvs?rev=345848&view=rev
Log:
om_node tests added 

Added:
    webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c
    webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.h
Modified:
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c
    webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h
    webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c
    webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_wrapper.c

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c Sun Nov 20 22:17:08 2005
@@ -462,7 +462,7 @@
         AXIS2_INTF_TO_IMPL(om_node)->prev_sibling;
     AXIS2_INTF_TO_IMPL(node_to_insert)->next_sibling = om_node;
     prev_sibling = AXIS2_INTF_TO_IMPL(om_node)->prev_sibling;
-    if (prev_sibling)
+    if (!prev_sibling)
     {
         axis2_om_node_t *parent = AXIS2_INTF_TO_IMPL(om_node)->parent;
         AXIS2_INTF_TO_IMPL(parent)->first_child = node_to_insert;

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c Sun Nov 20 22:17:08 2005
@@ -40,9 +40,12 @@
     }
     else
     {
-        om_output->xml_writer = axis2_xml_writer_create(env,stdout,
+        om_output->xml_writer = axis2_xml_writer_create(env, NULL,
                                                         DEFAULT_CHAR_SET_ENCODING,
-                                                        AXIS2_TRUE);
+                                                        AXIS2_TRUE,
+                                                        0);
+        if(!(om_output->xml_writer)) 
+            printf(" writer null");
     }
     om_output->do_optimize = AXIS2_FALSE;
     om_output->mime_boundary = 0;

Added: webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c?rev=345848&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c (added)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c Sun Nov 20 22:17:08 2005
@@ -0,0 +1,94 @@
+#include "om_node_test.h"
+#include <CuTest.h>
+
+void Testaxis2_om_node_add_child(CuTest *tc)
+{
+    axis2_om_node_t *parent;
+    axis2_om_node_t *child;
+    axis2_env_t *env;
+    axis2_allocator_t *allocator;
+    axis2_om_node_t *actual;
+    allocator = axis2_allocator_init(NULL);
+    env = axis2_env_create(allocator);
+    
+    parent = axis2_om_node_create(&env);   
+    child  = axis2_om_node_create(&env); 
+    
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, parent);
+    actual = AXIS2_OM_NODE_GET_FIRST_CHILD(parent, &env);
+    
+    CuAssertPtrEquals(tc, child, actual);  
+}
+
+void Testaxis2_om_node_set_parent(CuTest *tc)
+{
+    
+    axis2_om_node_t *parent;
+    axis2_om_node_t *child;
+    axis2_env_t *env;
+    axis2_allocator_t *allocator;
+    axis2_om_node_t *actual;
+    allocator = axis2_allocator_init(NULL);
+    env = axis2_env_create(allocator);
+    
+    parent = axis2_om_node_create(&env);   
+    child  = axis2_om_node_create(&env); 
+    
+    AXIS2_OM_NODE_SET_PARENT(child, &env, parent);
+    
+    actual = AXIS2_OM_NODE_GET_PARENT(child, &env);  
+    
+    CuAssertPtrEquals(tc, child, actual);
+}
+
+    
+void Testaxis2_om_node_insert_sibling_before(CuTest *tc)
+{
+    axis2_om_node_t *parent;
+    axis2_om_node_t *child;
+    axis2_om_node_t *sibling;
+    axis2_env_t *env;
+    axis2_allocator_t *allocator;
+    allocator = axis2_allocator_init(NULL);
+    env = axis2_env_create(allocator);
+    
+    parent = axis2_om_node_create(&env);   
+    child  = axis2_om_node_create(&env);
+    sibling = axis2_om_node_create(&env);
+
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, parent);
+    AXIS2_OM_NODE_INSERT_SIBLING_BEFORE(child, &env, sibling);
+    
+    CuAssertPtrEquals(tc, sibling,AXIS2_OM_NODE_GET_FIRST_CHILD(parent, &env));    
+
+}
+void Testaxis2_om_node_insert_sibling_after(CuTest *tc)
+{
+    axis2_om_node_t *parent;
+    axis2_om_node_t *child;
+    axis2_om_node_t *sibling;
+    axis2_env_t *env;
+    axis2_allocator_t *allocator;
+    allocator = axis2_allocator_init(NULL);
+    env = axis2_env_create(allocator);
+    
+    parent = axis2_om_node_create(&env);   
+    child  = axis2_om_node_create(&env);
+    sibling = axis2_om_node_create(&env);
+
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, parent);
+    AXIS2_OM_NODE_INSERT_SIBLING_AFTER(child, &env, sibling);
+    
+    CuAssertPtrEquals(tc, sibling,AXIS2_OM_NODE_GET_NEXT_SIBLING(child, &env));    
+}
+void Testaxis2_om_node_detach(CuTest *tc)
+{
+    
+    
+    
+    
+    
+    
+    
+    
+}

Added: webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.h?rev=345848&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.h (added)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.h Sun Nov 20 22:17:08 2005
@@ -0,0 +1,15 @@
+#ifndef OM_NODE_TEST_H
+#define OM_NODE_TEST_H
+
+
+#include <CuTest.h>
+#include <axis2_env.h>
+#include <axis2_om_node.h>
+
+void Testaxis2_om_node_add_child(CuTest *tc);
+void Testaxis2_om_node_set_parent(CuTest *tc);
+void Testaxis2_om_node_insert_sibling_after(CuTest *tc);
+void Testaxis2_om_node_insert_sibling_before(CuTest *tc);
+void Testaxis2_om_node_detach(CuTest *tc);
+
+#endif /* OM_NODE_TEST_H */

Modified: webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h Sun Nov 20 22:17:08 2005
@@ -242,7 +242,16 @@
 axis2_xml_writer_create(axis2_env_t **env,
                         void *stream,
                         axis2_char_t *encoding,
-                        int is_prefix_default);
+                        int is_prefix_default,
+                        int compression);
+AXIS2_DECLARE(axis2_xml_writer_t *)
+
+
+axis2_xml_writer_create_for_memory(axis2_env_t **env,
+                                   void *buffer,
+                                   axis2_char_t *encoding,
+                                   int is_prefix_default,
+                                   int compression);
 
 /********************** start macros *******************************************/
 

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c
(original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/impl/src/guththila_xml_stream_writer.c
Sun Nov 20 22:17:08 2005
@@ -42,13 +42,11 @@
     /*   guththila_status_t status; */
     guththila_xml_stream_writer_t *stream_writer;
     FILE *fp = NULL;
-    if (!writer)
-        return 0;
 
     stream_writer =
         (guththila_xml_stream_writer_t *) GUTHTHILA_MALLOC (environment->allocator,
                                           sizeof(guththila_xml_stream_writer_t));
-    if(writer)
+    if(writer != NULL)
     {
         fp = fopen(writer, "w");
         if(!fp)
@@ -56,7 +54,7 @@
         stream_writer->writer = fp;
     }
     else{
-    stream_writer->writer = stdout;
+      stream_writer->writer = stdout;
     }
     stream_writer->encoding = NULL;
     if (encoding)

Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c
(original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c
Sun Nov 20 22:17:08 2005
@@ -215,7 +215,9 @@
 AXIS2_DECLARE(axis2_xml_writer_t *)
 axis2_xml_writer_create(axis2_env_t **env,
                         void *stream,
-                        axis2_char_t *encoding, int is_prefix_default)
+                        axis2_char_t *encoding,
+                        int is_prefix_default,
+                        int compression)
 {
     guththila_xml_writer_wrapper_impl_t *writer_impl;
     guththila_allocator_t *allocator;
@@ -231,6 +233,7 @@
     
     allocator = guththila_allocator_init(NULL);
     writer_impl->guththila_env = guththila_environment_create(allocator, NULL,  NULL);
+    
     writer_impl->guththila_writer = guththila_create_xml_stream_writer(
                                                     writer_impl->guththila_env,
                                                     stream, encoding , 

Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_wrapper.c?rev=345848&r1=345847&r2=345848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_wrapper.c Sun Nov
20 22:17:08 2005
@@ -21,7 +21,10 @@
  #include <axis2.h>
  #include <string.h>
  
- /*************************** Function Prototypes ******************************/
+/*************************** Function Prototypes ******************************/
+
+#define AXIS2_ATTR_NS_MAX   20
+
  
 int AXIS2_CALL
 axis2_libxml2_wrapper_next(axis2_pull_parser_t *parser,
@@ -111,8 +114,8 @@
 	int event_map[18];
     /* assuming that max ns and attri will be 20 */
     
-    int namespace_map[20];
-    int attribute_map[20];
+    int namespace_map[AXIS2_ATTR_NS_MAX];
+    int attribute_map[AXIS2_ATTR_NS_MAX];
 }axis2_libxml2_wrapper_impl_t;
 
 /****************** End struct , Macro *****************************************/
@@ -664,7 +667,7 @@
     if(libxml2_attribute_count == 0)
         return;
     
-    for(i = 0;i<20;i++)
+    for(i = 0;i < AXIS2_ATTR_NS_MAX ;i++)
     {
         parser_impl->namespace_map[i] = -1;
         parser_impl->attribute_map[i] = -1;        



Mime
View raw message