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/11 06:57:41 UTC
svn commit: r332458 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp
Author: jamejose
Date: Thu Nov 10 21:57:26 2005
New Revision: 332458
URL: http://svn.apache.org/viewcvs?rev=332458&view=rev
Log:
Updated the testcase with new Array APIs
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp?rev=332458&r1=332457&r2=332458&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_timeClient.cpp Thu Nov 10 21:57:26 2005
@@ -115,26 +115,32 @@
delete optionalAttributeResult;
*/
// Test array
- xsd__time_Array arrayInput;
- arrayInput.m_Array = new xsd__time*[2];
- xsd__time * array = new xsd__time[2];
- arrayInput.m_Size = 2;
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+ xsd__time_Array arrayInput;
+ int arraySize = 2;
+ xsd__time ** array = new xsd__time*[arraySize];
+
+ for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
{
- array[inputIndex] = time;
- arrayInput.m_Array[inputIndex] = &array[inputIndex];
+ array[inputIndex] = new xsd__time(time);
}
- xsd__time_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__time_Array* arrayResult = ws->asArray(&arrayInput);
+ int outputSize=0;
+ const xsd__time ** output = arrayResult->get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- strftime(returnString, 50, "%H:%M:%S", arrayResult.m_Array[index]);
+ strftime(returnString, 50, "%H:%M:%S", 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;