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/10 11:16:08 UTC
svn commit: r332264 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp
Author: jamejose
Date: Thu Nov 10 02:15:50 2005
New Revision: 332264
URL: http://svn.apache.org/viewcvs?rev=332264&view=rev
Log:
Updated the testcase with new Array APIs
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp?rev=332264&r1=332263&r2=332264&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_gYearClient.cpp Thu Nov 10 02:15:50 2005
@@ -116,25 +116,32 @@
*/
// Test array
xsd__gYear_Array arrayInput;
- arrayInput.m_Array = new xsd__gYear*[2];
- xsd__gYear * array = new xsd__gYear[2];
- arrayInput.m_Size = 2;
+ int arraySize = 2;
+ xsd__gYear ** array = new xsd__gYear*[arraySize];
+
for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
{
- array[inputIndex] = time;
- arrayInput.m_Array[inputIndex] = &array[inputIndex];
+ array[inputIndex] = new xsd__gYear(time);
+
}
- xsd__gYear_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__gYear_Array* arrayResult = ws->asArray(&arrayInput);
+ int outputSize = 0;
+ const xsd__gYear **output = arrayResult->get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- strftime(returnString, 50, "%Y", arrayResult.m_Array[index]);
+ strftime(returnString, 50, "%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;