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/10 10:42:56 UTC

svn commit: r332253 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp

Author: jamejose
Date: Thu Nov 10 01:42:39 2005
New Revision: 332253

URL: http://svn.apache.org/viewcvs?rev=332253&view=rev
Log:
Updated the testcase with new Array APIs

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

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp?rev=332253&r1=332252&r2=332253&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_dateClient.cpp Thu Nov 10 01:42:39 2005
@@ -116,25 +116,31 @@
 */
         // Test array
         xsd__date_Array arrayInput;
-        arrayInput.m_Array = new xsd__date*[2];
-        xsd__date * array = new xsd__date[2];
-        arrayInput.m_Size = 2;
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+		int arraySize = 2;
+		xsd__date ** array = new xsd__date*[arraySize];
+        
+        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
         {
-            array[inputIndex] = time;
-            arrayInput.m_Array[inputIndex] = &array[inputIndex];
+            array[inputIndex] =new xsd__date(time);
+            
         }
-        xsd__date_Array arrayResult = ws->asArray(arrayInput);
-        cout << "array of " << arrayResult.m_Size << " elements" << endl;
-        for (int index = 0; index < arrayResult.m_Size ; index++)
+		array.set(array,arraySize);
+        xsd__date_Array* arrayResult = ws->asArray(&arrayInput);
+		int outputSize = 0;
+		const xsd__date **output = arrayResult.get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
         {
-            strftime(returnString, 50, "%a %b %d %Y", arrayResult.m_Array[index]);
+            strftime(returnString, 50, "%a %b %d %Y", 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;