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/14 14:21:20 UTC

svn commit: r344116 - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp

Author: jamejose
Date: Mon Nov 14 05:21:07 2005
New Revision: 344116

URL: http://svn.apache.org/viewcvs?rev=344116&view=rev
Log:
Updated the testcase with new Array APIs

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp?rev=344116&r1=344115&r2=344116&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/XSD_NMTOKENSClient.cpp Mon Nov 14 05:21:07 2005
@@ -299,37 +299,46 @@
 
         // Test array
         xsd__NMTOKENS_Array arrayInput;
-        arrayInput.m_Array = new xsd__NMTOKENS[2];
-        arrayInput.m_Size = 2;
-        for (int inputIndex=0 ; inputIndex < 2 ; inputIndex++)
+		int arraySize = 2;
+		xsd__NMTOKENS * array = new xsd__NMTOKENS[arraySize];
+        
+        for (int inputIndex=0 ; inputIndex < arraySize ; inputIndex++)
         {
-            input = new char[25];
-            strcpy (input, simpleNMTOKENS);
-            arrayInput.m_Array[inputIndex] = input;
+            array[inputIndex] = new char[25];
+            strcpy (array[inputIndex], simpleNMTOKENS);            
         }
-        xsd__NMTOKENS_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__NMTOKENS_Array* arrayResult = ws->asArray(&arrayInput);
+		int outputSize =0;
+		const xsd__NMTOKENS * output = arrayResult->get(outputSize);
+        cout << "array of " << outputSize << " elements" << endl;
+        for (int index = 0; index < outputSize ; index++)
         {
-            if (arrayResult.m_Array[index])
+            if (output[index])
             {
-                if (*(arrayResult.m_Array[index]))
+                if (*(output[index]))
                 {
-                    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        
+        for (int deleteIndex = 0 ; deleteIndex < arraySize ; deleteIndex++ )
+        {
+            delete array[deleteIndex];
+        }
+        delete [] array;
 
         // Test complex type
         input = new char[25];