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/10/27 12:08:31 UTC

svn commit: r328844 - in /webservices/axis2/trunk/c/modules/xml/om/test: Makefile.am om_test.c om_test.h

Author: damitha
Date: Thu Oct 27 03:08:16 2005
New Revision: 328844

URL: http://svn.apache.org/viewcvs?rev=328844&view=rev
Log:
Added files required to add unit tests for om

Added:
    webservices/axis2/trunk/c/modules/xml/om/test/Makefile.am
    webservices/axis2/trunk/c/modules/xml/om/test/om_test.h
Modified:
    webservices/axis2/trunk/c/modules/xml/om/test/om_test.c

Added: webservices/axis2/trunk/c/modules/xml/om/test/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/Makefile.am?rev=328844&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/Makefile.am (added)
+++ webservices/axis2/trunk/c/modules/xml/om/test/Makefile.am Thu Oct 27 03:08:16 2005
@@ -0,0 +1,14 @@
+prgbindir=$(prefix)/bin/unit_test
+prglibdir=$(prefix)/lib/unit_test
+prglib_LTLIBRARIES = libtest_om.la
+AM_CPPFLAGS = $(CPPFLAGS)
+libtest_om_la_SOURCES = om_test.c
+include_HEADERS=$(top_builddir)/modules/om/test/*.h
+
+libtest_om_la_LIBADD = $(LDFLAGS) $(top_builddir)/modules/om/src/libaxis2_om.la
+INCLUDES = -I$(top_builddir)/include -I${CUTEST_HOME}/include
+
+prgbin_PROGRAMS = om_test
+om_test_SOURCES = main.c
+om_test_LDADD   =  $(LDFLAGS) libtest_om.la  $(top_builddir)/modules/om/src/libaxis2_om.la
+

Modified: webservices/axis2/trunk/c/modules/xml/om/test/om_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/om_test.c?rev=328844&r1=328843&r2=328844&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_test.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_test.c Thu Oct 27 03:08:16 2005
@@ -1,47 +1,12 @@
-#include <CuTest.h>
+#include "om_test.h"
 #include <string.h>
 #include <stdio.h>
-#include <axis2_om_node.h>
+#include <axis2_allocator.h>
+#include <axis2_environment.h>
 
-void Testnode_detach(CuTest *tc) {
-	axis2_om_node_t* parent = axis2_om_node_create();
-    axis2_om_node_t* prev_sibling = axis2_om_node_create();
-    axis2_om_node_add_child(parent, prev_sibling);
-    axis2_om_node_t* test_node = axis2_om_node_create();
-    axis2_om_node_add_child(parent, test_node);
-    axis2_om_node_t* next_sibling = axis2_om_node_create();
-    axis2_om_node_add_child(parent, next_sibling);
-        
-    axis2_om_node_t* temp_parent = axis2_om_node_detach(test_node);
-    puts("came");
-    if(0 == temp_parent) puts("parent is null\n");
-    axis2_om_node_t* expected = temp_parent->first_child;
-    printf("came2");
-    if(0 == expected) puts("expected is null\n");
-        axis2_om_node_t* actual = next_sibling;
-
-    CuAssertPtrEquals(tc, expected, actual); 
-}
-
-CuSuite* node_detachGetSuite() {
+CuSuite* axis2_omGetSuite() {
     CuSuite* suite = CuSuiteNew();
-    SUITE_ADD_TEST(suite, Testnode_detach);
+    /*SUITE_ADD_TEST(suite, Testaxis2_stream_ops_read);*/
     return suite;
 }
 
- void RunAllTests(void) {
-    CuString *output = CuStringNew();
-    CuSuite* suite = CuSuiteNew();
-
-    CuSuiteAddSuite(suite, node_detachGetSuite());
-
-    CuSuiteRun(suite);
-    CuSuiteSummary(suite, output);
-    CuSuiteDetails(suite, output);
-    printf("%s\n", output->buffer);
-}
-
-int main(void) {
-    RunAllTests();
-    return 0;
-}

Added: webservices/axis2/trunk/c/modules/xml/om/test/om_test.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/om_test.h?rev=328844&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_test.h (added)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_test.h Thu Oct 27 03:08:16 2005
@@ -0,0 +1,12 @@
+#ifndef OM_TEST_H
+#define OM_TEST_H
+
+#include <CuTest.h>
+#include "om_stream_test.h"
+#include "om_log_test.h"
+#include "om_hash_test.h"
+#include "om_error_test.h"
+
+CuSuite* axis2_omGetSuite();
+
+#endif /* OM_TEST_H */