You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/11/21 07:31:46 UTC

svn commit: r345850 - /webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c

Author: samisa
Date: Sun Nov 20 22:31:41 2005
New Revision: 345850

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

Modified:
    webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c

Modified: 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=345850&r1=345849&r2=345850&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_node_test.c Sun Nov 20 22:31:41 2005
@@ -16,8 +16,8 @@
     
     AXIS2_OM_NODE_ADD_CHILD(child, &env, parent);
     actual = AXIS2_OM_NODE_GET_FIRST_CHILD(parent, &env);
-    
     CuAssertPtrEquals(tc, child, actual);  
+    axis2_env_free(env);
 }
 
 void Testaxis2_om_node_set_parent(CuTest *tc)
@@ -35,10 +35,8 @@
     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);
+    CuAssertPtrEquals(tc, parent, AXIS2_OM_NODE_GET_PARENT(child, &env));
+    axis2_env_free(env);    
 }
 
     
@@ -60,7 +58,7 @@
     AXIS2_OM_NODE_INSERT_SIBLING_BEFORE(child, &env, sibling);
     
     CuAssertPtrEquals(tc, sibling,AXIS2_OM_NODE_GET_FIRST_CHILD(parent, &env));    
-
+    axis2_env_free(env);
 }
 void Testaxis2_om_node_insert_sibling_after(CuTest *tc)
 {
@@ -79,16 +77,35 @@
     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));    
+    CuAssertPtrEquals(tc, sibling,AXIS2_OM_NODE_GET_NEXT_SIBLING(child, &env));
+    axis2_env_free(env);    
 }
 void Testaxis2_om_node_detach(CuTest *tc)
 {
+    axis2_om_node_t *parent;
+    axis2_om_node_t *child;
+    axis2_om_node_t *sibling1;
+    axis2_om_node_t *sibling2;
     
+    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);
+    sibling1 = axis2_om_node_create(&env);
+    sibling2 = axis2_om_node_create(&env);
     
     
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, parent);
+    AXIS2_OM_NODE_ADD_CHILD(sibling1, &env, parent);
+    AXIS2_OM_NODE_ADD_CHILD(sibling2, &env, parent);
+
+    CuAssertPtrEquals(tc, sibling1, AXIS2_OM_NODE_GET_NEXT_SIBLING(child, &env));
+
+    AXIS2_OM_NODE_DETACH(sibling1, &env);
     
-    
-    
-    
+    CuAssertPtrEquals(tc, sibling2, AXIS2_OM_NODE_GET_NEXT_SIBLING(child, &env));
+    axis2_env_free(env);    
 }