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

svn commit: r331777 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp

Author: jamejose
Date: Tue Nov  8 02:28:06 2005
New Revision: 331777

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

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp?rev=331777&r1=331776&r2=331777&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_doubleClient.cpp Tue Nov  8 02:28:06 2005
@@ -111,25 +111,28 @@
 
      // Test array
         xsd__double_Array arrayInput;
-        arrayInput.m_Array = new xsd__double*[2];
-        xsd__double * array = new xsd__double[2];
-        arrayInput.m_Size = 2;
+		int arraySize=2;
+		xsd__double **array =new xsd__double*[arraySize];        
         for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
         {
-            array[inputIndex] = (xsd__double)70.7175888888;
-            arrayInput.m_Array[inputIndex] = &array[inputIndex];
+            array[inputIndex] =new xsd__double(70.7175888888);          
         }
+		arrayInput.set(array,arraySize);
         xsd__double_Array arrayResult = ws->asArray(arrayInput);
-        cout << "array of " << arrayResult.m_Size << " elements" << endl;
-        for (int index = 0; index < arrayResult.m_Size ; index++)
-     {
-         printf("  element[%i]=%.5f\n", index,  *((arrayResult.m_Array[index])));
+		int outputSize=0;
+		const xsd__double ** output=arrayResult.get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
+         {
+         printf("  element[%i]=%.5f\n", index,  *(output[index]));
             fflush(stdout);
-         delete arrayResult.m_Array[index];
+        }
+	  // 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;