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 15:26:47 UTC
svn commit: r331825 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp
Author: jamejose
Date: Tue Nov 8 06:26:26 2005
New Revision: 331825
URL: http://svn.apache.org/viewcvs?rev=331825&view=rev
Log:
Updated the testcase with new memory model of Arrays
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp?rev=331825&r1=331824&r2=331825&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_unsignedLongClient.cpp Tue Nov 8 06:26:26 2005
@@ -109,24 +109,30 @@
// Test array
xsd__unsignedLong_Array arrayInput;
- arrayInput.m_Array = new xsd__unsignedLong*[2];
- xsd__unsignedLong * array = new xsd__unsignedLong[2];
- arrayInput.m_Size = 2;
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+ int arraySize =2;
+ xsd__unsignedLong ** array = new xsd__unsignedLong*[arraySize]();
+
+ for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
{
- array[inputIndex] = 123456789;
- arrayInput.m_Array[inputIndex] = &array[inputIndex];
+ array[inputIndex] = new xsd__unsignedLong(123456789);
+
}
+ arrayInput.set(array,arraySize);
xsd__unsignedLong_Array arrayResult = ws->asArray(arrayInput);
- cout << "array of " << arrayResult.m_Size << " elements" << endl;
- for (int index = 0; index < arrayResult.m_Size ; index++)
+ int outputSize =0;
+ const xsd__unsignedLong ** output = arrayResult.get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- cout << " element[" << index << "]=" << *((xsd__unsignedLong*)(arrayResult.m_Array[index])) << endl;
- delete arrayResult.m_Array[index];
+ cout << " element[" << index << "]=" << *((xsd__unsignedLong*)(output[index])) << endl;
+
+ }
+ // 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;