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/08 10:58:31 UTC
svn commit: r331767 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp
Author: jamejose
Date: Tue Nov 8 01:58:09 2005
New Revision: 331767
URL: http://svn.apache.org/viewcvs?rev=331767&view=rev
Log:
Updated the testcase with new memory model for Arrays
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp?rev=331767&r1=331766&r2=331767&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_byteClient.cpp Tue Nov 8 01:58:09 2005
@@ -112,24 +112,29 @@
// Test array
xsd__byte_Array arrayInput;
- arrayInput.m_Array = new xsd__byte*[2];
- xsd__byte * array = new xsd__byte[2];
- arrayInput.m_Size = 2;
+ int arraySize=2;
+ xsd__byte **array = new xsd__byte*[arraySize]();
+
for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
{
- array[inputIndex] = 123;
- arrayInput.m_Array[inputIndex] = &array[inputIndex];
+ array[inputIndex] = new xsd__byte(123);
}
+ arrayInput.set(array,arraySize);
xsd__byte_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__byte ** output=arrayResult.get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- cout << " element[" << index << "]=" << (int) *(arrayResult.m_Array[index]) << endl;
- delete arrayResult.m_Array[index];
+ cout << " element[" << index << "]=" << (int)*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;