axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r332012 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp
Date Wed, 09 Nov 2005 09:48:34 GMT
Author: dicka
Date: Wed Nov  9 01:48:32 2005
New Revision: 332012

URL: http://svn.apache.org/viewcvs?rev=332012&view=rev
Log:
Update XSD_gDay testcase to use new array API.

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp?rev=332012&r1=332011&r2=332012&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp Wed
Nov  9 01:48:32 2005
@@ -114,27 +114,34 @@
         }
         delete optionalAttributeResult;
 */
+
         // Test array
         xsd__gDay_Array arrayInput;
-        arrayInput.m_Array = new xsd__gDay*[2];
-        xsd__gDay * array = new xsd__gDay[2];
-        arrayInput.m_Size = 2;
+		int arraySize=2;
+		xsd__gDay ** array = new xsd__gDay*[arraySize];
+        
         for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
         {
-            array[inputIndex] = time;
-            arrayInput.m_Array[inputIndex] = &array[inputIndex];
+            array[inputIndex] = new xsd__gDay(time);
+           
         }
-        xsd__gDay_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__gDay_Array* arrayResult = ws->asArray(&arrayInput);
+		int outputSize=0;
+		const xsd__gDay ** output = arrayResult->get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
         {
-            strftime(returnString, 50, "%d", arrayResult.m_Array[index]);
+            strftime(returnString, 50, "%d", output[index]);
             cout << "  element[" << index << "]=" << returnString
<< endl;
-            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;



Mime
View raw message