axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamej...@apache.org
Subject svn commit: r344114 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp
Date Mon, 14 Nov 2005 13:13:21 GMT
Author: jamejose
Date: Mon Nov 14 05:13:10 2005
New Revision: 344114

URL: http://svn.apache.org/viewcvs?rev=344114&view=rev
Log:
Updated the testcase with new Array APIs

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp?rev=344114&r1=344113&r2=344114&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NOTATIONClient.cpp
Mon Nov 14 05:13:10 2005
@@ -299,37 +299,45 @@
 
         // Test array
         xsd__NOTATION_Array arrayInput;
-        arrayInput.m_Array = new xsd__NOTATION[2];
-        arrayInput.m_Size = 2;
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+		int arraySize = 0;
+		xsd__NOTATION * array = new xsd__NOTATION[arraySize];
+        
+        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
         {
-            input = new char[25];
-            strcpy (input, simpleNOTATION);
-            arrayInput.m_Array[inputIndex] = input;
+            array[inputIndex] = new char[25];
+            strcpy (array[inputIndex], simpleNOTATION);            
         }
-        xsd__NOTATION_Array arrayResult = ws->asArray(arrayInput);
-        cout << "array of " << arrayResult.m_Size << " elements" <<
endl;
-        for (int index = 0; index < arrayResult.m_Size ; index++)
+		arrayInput.set(array,arraySize);
+        xsd__NOTATION_Array* arrayResult = ws->asArray(&arrayInput);
+		int outputSize = 0;
+		const xsd__NOTATION * output = arrayResult->get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
         {
-            if (arrayResult.m_Array[index])
+            if (output[index])
             {
-                if (*(arrayResult.m_Array[index]))
+                if (*(output[index]))
                 {
-                    cout << "  element[" << index << "]=" << arrayResult.m_Array[index]
<< endl;
+                    cout << "  element[" << index << "]=" << output[index]
<< endl;
                 }
                 else
                 {
                     cout << "  element[" << index << "]=<empty>"
<< endl;
                 }
-                delete arrayResult.m_Array[index];
+               
             }
             else
             {
                 cout << "  element[" << index << "]=<nil>" <<
endl;
             }
         }
-        delete [] arrayInput.m_Array;
-        delete [] arrayResult.m_Array;
+
+       // Clear up input array        
+        for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+        {
+            delete array[deleteIndex];
+        }
+        delete [] array;
 
         // Test complex type
         input = new char[25];



Mime
View raw message