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 10:43:07 UTC

svn commit: r331758 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp

Author: jamejose
Date: Tue Nov  8 01:42:47 2005
New Revision: 331758

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

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp?rev=331758&r1=331757&r2=331758&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_booleanClient.cpp Tue Nov  8 01:42:47 2005
@@ -116,25 +116,29 @@
 */
 
 		// Test array
+
         xsd__boolean_Array arrayInput;
-        arrayInput.m_Array = new xsd__boolean*[2];
-        xsd__boolean * array = new xsd__boolean[2];
-        arrayInput.m_Size = 2;
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+		int arraySize=2;
+		xsd__boolean ** array = new xsd__boolean*[arraySize]();        
+        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
         {
-            array[inputIndex] = true_;
-            arrayInput.m_Array[inputIndex] = &array[inputIndex];
+            array[inputIndex] = new xsd__boolean(true_);            
         }
+		arrayInput.set(array,arraySize);
 		xsd__boolean_Array arrayResult = ws->asArray(arrayInput);
-        cout << "array of " << arrayResult.m_Size << " elements" << endl;
-		for (int index = 0; index < arrayResult.m_Size ; index++)
+		int outputSize=2;
+		const xsd__boolean **output = arrayResult.get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+		for (int index = 0; index < outputSize; index++)
 		{
-			cout << "  element[" << index << "]=" << *((xsd__boolean*)(arrayResult.m_Array[index])) << endl;
-			delete arrayResult.m_Array[index];
+			cout << "  element[" << index << "]=" << (*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;