axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamej...@apache.org
Subject svn commit: r331735 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_QNameClient.cpp
Date Tue, 08 Nov 2005 08:39:31 GMT
Author: jamejose
Date: Tue Nov  8 00:39:21 2005
New Revision: 331735

URL: http://svn.apache.org/viewcvs?rev=331735&view=rev
Log:
Updated the testcase with new memory model for Arrays

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_QNameClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_QNameClient.cpp?rev=331735&r1=331734&r2=331735&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_QNameClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_QNameClient.cpp Tue
Nov  8 00:39:21 2005
@@ -298,38 +298,47 @@
 */
 
         // Test array
-        xsd__QName_Array arrayInput;
-        arrayInput.m_Array = new xsd__QName[2];
-        arrayInput.m_Size = 2;
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+          xsd__QName_Array arrayInput;
+		int arraySize=2;
+		xsd__QName *array = new xsd__QName[arraySize]();
+        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
         {
             input = new char[25];
             strcpy (input, simpleQName);
-            arrayInput.m_Array[inputIndex] = input;
+            array[inputIndex] = input;
         }
+		arrayInput.set(array,arraySize);
         xsd__QName_Array arrayResult = ws->asArray(arrayInput);
-        cout << "array of " << arrayResult.m_Size << " elements" <<
endl;
-        for (int index = 0; index < arrayResult.m_Size ; index++)
+		int outputSize=0;
+		const xsd__QName *output = arrayResult.get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
         {
-            if (arrayResult.m_Array[index])
+            if (output!=NULL)
             {
-                if (*(arrayResult.m_Array[index]))
+                if (output[index]!=NULL)
                 {
-                    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