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 14:26:08 UTC
svn commit: r331815 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp
Author: jamejose
Date: Tue Nov 8 05:25:54 2005
New Revision: 331815
URL: http://svn.apache.org/viewcvs?rev=331815&view=rev
Log:
Updated the testcase with new memory model of Arrays
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp?rev=331815&r1=331814&r2=331815&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_shortClient.cpp Tue Nov 8 05:25:54 2005
@@ -112,24 +112,30 @@
// Test array
xsd__short_Array arrayInput;
- arrayInput.m_Array = new xsd__short*[2];
- xsd__short * array = new xsd__short[2];
- arrayInput.m_Size = 2;
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+ int arraySize=2;
+ xsd__short ** array = new xsd__short*[arraySize]();
+
+ for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
{
- array[inputIndex] = 12345;
- arrayInput.m_Array[inputIndex] = &array[inputIndex];
+ array[inputIndex] = new xsd__short(12345);
+
}
+ arrayInput.set(array,arraySize);
xsd__short_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__short ** output = arrayResult.get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- cout << " element[" << index << "]=" << *((xsd__short*)(arrayResult.m_Array[index])) << endl;
- delete arrayResult.m_Array[index];
+ cout << " element[" << index << "]=" << *((xsd__short*)(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;