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 ja...@apache.org on 2005/11/08 11:33:38 UTC

svn commit: r331778 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp

Author: jamejose
Date: Tue Nov  8 02:33:23 2005
New Revision: 331778

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

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp?rev=331778&r1=331777&r2=331778&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_durationClient.cpp Tue Nov  8 02:33:23 2005
@@ -104,24 +104,31 @@
 */
 		// Test array
         xsd__duration_Array arrayInput;
-        arrayInput.m_Array = new xsd__duration*[2];
-        xsd__duration * array = new xsd__duration[2];
-        arrayInput.m_Size = 2;
+		int arraySize=2;
+		xsd__duration ** array = new xsd__duration*[arraySize];        
         for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
         {
-            array[inputIndex] = 123456789;
-            arrayInput.m_Array[inputIndex] = &array[inputIndex];
+            array[inputIndex] = new xsd__duration(123456789);
+            
         }
+		arrayInput.set(array,arraySize);
 		xsd__duration_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__duration **output = arrayResult.get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+		for (int index = 0; index < outputSize; index++)
 		{
-			cout << "  element[" << index << "]=" << *((xsd__duration*)(arrayResult.m_Array[index])) << endl;
-			delete arrayResult.m_Array[index];
+			cout << "  element[" << index << "]=" << *((xsd__duration*)output[index]) << endl;
+			
 		}
+      
+		 // Clear up input array        
+        for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+        {
+            delete array[deleteIndex];
+        }
         delete [] array;
-        delete [] arrayInput.m_Array;
-		delete [] arrayResult.m_Array;
+
 
 		// Test complex type
 		SimpleComplexType complexTypeInput;