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 14:35:54 UTC
svn commit: r331817 -
/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp
Author: jamejose
Date: Tue Nov 8 05:35:34 2005
New Revision: 331817
URL: http://svn.apache.org/viewcvs?rev=331817&view=rev
Log:
Updated the testcase with new memory model of Arrays
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp?rev=331817&r1=331816&r2=331817&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_tokenClient.cpp Tue Nov 8 05:35:34 2005
@@ -236,37 +236,42 @@
// Test array
xsd__token_Array arrayInput;
- arrayInput.m_Array = new xsd__token[2];
- arrayInput.m_Size = 2;
- for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+ int arraySize=2;
+ xsd__token * array = new xsd__token[arraySize]();
+
+ for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
{
input = new char[25];
strcpy (input, simpletoken);
- arrayInput.m_Array[inputIndex] = input;
+ array[inputIndex] = input;
}
+ arrayInput.set(array,arraySize);
xsd__token_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__token * output = arrayResult.get(outputSize);
+ cout << "array of " << outputSize << " elements" << endl;
+ for (int index = 0; index < outputSize ; index++)
{
- if (arrayResult.m_Array[index])
+ if (output !=NULL)
{
- if (*(arrayResult.m_Array[index]))
+ if (output[index]!=NULL)
{
- cout << " element[" << index << "]=" << arrayResult.m_Array[index] << endl;
+ cout << " element[" << index << "]=" << output[index] << endl;
}
else
{
cout << " element[" << index << "]=<empty>" << endl;
}
- delete arrayResult.m_Array[index];
+
}
else
{
cout << " element[" << index << "]=<nil>" << endl;
}
}
- delete [] arrayInput.m_Array;
- delete [] arrayResult.m_Array;
+ // Clear up input array
+
+ delete [] array;
// Test complex type
input = new char[25];