ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r397747 [5/17] - /webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/
Date Fri, 28 Apr 2006 03:04:04 GMT
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/EnumerationClient.cpp Thu Apr 27 20:03:51 2006
@@ -13,6 +13,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* ----------------------------------------------------------------   */
+/* CHANGES TO THIS FILE MAY ALSO REQUIRE CHANGES TO THE               */
+/* C-EQUIVALENT FILE. PLEASE ENSURE THAT IT IS DONE.                  */
+/* ----------------------------------------------------------------   */
+/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE   */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
 
 #include "EnumerationWS.hpp" 
 #include <stdlib.h> // For malloc(), calloc(), strdup() and free()
@@ -44,11 +52,11 @@
 
   endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
 
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
 
-		do
-		{
+                do
+                {
   try {
     if(endpoint_set) {
       ws = new EnumerationWS(endpoint, APTHTTP1_1);
@@ -79,45 +87,45 @@
       returnValue = 0; // Success
     }
 
-	bSuccess = true;
+        bSuccess = true;
   } catch(AxisException &e) {
-			bool bSilent = false;
+                        bool bSilent = false;
 
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
+                        {
     cout << e.what() << endl;
-			}
+                        }
   } catch(...) {
     cout << "Unknown Exception occured." << endl;
   }
   try
   {
-	  delete ws;
-	  delete input;
-	  delete result;
+          delete ws;
+          delete input;
+          delete result;
   }
   catch(exception& exception)
   {
-  	cout << "Exception when cleaning up: " << exception.what()<<endl;
+        cout << "Exception when cleaning up: " << exception.what()<<endl;
   }
   catch(...)
   {
-  	cout << "Unknown exception when cleaning up: "<<endl;
+        cout << "Unknown exception when cleaning up: "<<endl;
   }
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
     if(endpoint_set)
       free(endpoint);
   cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/Enumeration_TTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/Enumeration_TTestClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/Enumeration_TTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/Enumeration_TTestClient.cpp Thu Apr 27 20:03:51 2006
@@ -53,59 +53,59 @@
         const char* url="http://puppet.in.ibm.com:9060/ComplexTypeAll/services/Service";
         if(p!=NULL)
              url=p;
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
 
-		do
-		{
+                do
+                {
         try
         {
-                sprintf(endpoint, "%s", url);				
-				EnumerationWS *ws;
-				Type1* input = NULL;
-				Type1* result = NULL;
-				ws = new EnumerationWS(endpoint, APTHTTP1_1);				
-				input = new Type1();
-				input->enum_string="one";
-				input->att_enum_string="one";
-				input->enum_int=ENUMTYPEINT_0;
-				input->att_enum_int=ENUMTYPEINT_1;
-				input->att_enum_kind="CHEQUE";
-				result = ws->getInput(input);
-				if ( result == NULL ) {
-					cout << "  result = NULL" << endl;
-				} else {
-					cout << result->att_enum_int;
-				}
-					
-				//free(p);
-				//free(url);
-				delete ws;
-				delete input;
-				delete result;
-				bSuccess = true;
+                sprintf(endpoint, "%s", url);                           
+                                EnumerationWS *ws;
+                                Type1* input = NULL;
+                                Type1* result = NULL;
+                                ws = new EnumerationWS(endpoint, APTHTTP1_1);                           
+                                input = new Type1();
+                                input->enum_string="one";
+                                input->att_enum_string="one";
+                                input->enum_int=ENUMTYPEINT_0;
+                                input->att_enum_int=ENUMTYPEINT_1;
+                                input->att_enum_kind="CHEQUE";
+                                result = ws->getInput(input);
+                                if ( result == NULL ) {
+                                        cout << "  result = NULL" << endl;
+                                } else {
+                                        cout << result->att_enum_int;
+                                }
+                                        
+                                //free(p);
+                                //free(url);
+                                delete ws;
+                                delete input;
+                                delete result;
+                                bSuccess = true;
 
         }
         catch(AxisException& e)
         {
-			bool bSilent = false;
+                        bool bSilent = false;
 
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
-				cout << "Exception : " << e.what() << endl;
-			}
+                        {
+                                cout << "Exception : " << e.what() << endl;
+                        }
         }
         catch(exception& e)
         {
@@ -115,8 +115,8 @@
         {
             cout << "Unknown exception has occured" << endl;
         }
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
                 #ifndef WIN32
                         pthread_exit(0);
                 #endif
@@ -129,60 +129,60 @@
 int main(int argc, char *argv[])
 {
     Axis::initialize(false);
-	try{
-		 int i;
-		 #ifdef WIN32
-			/*Windows specific code comes here */
-			HANDLE hThread[NUM_THREADS];
-			for(i=0;i<NUM_THREADS;i++){
-					DWORD dwThreadId;
-					//LPVOID dwThrdParam = LPVOID(argv[1]);
-					hThread[i] = CreateThread(
-											NULL,                        // no security attributes
-											0,                           // use default stack size
-											ThreadFunc,                  // thread function
-											LPVOID(argv[1]),             // argument to thread function
-											0,   
-										&dwThreadId);              // returns the thread identifier
-
-			if (hThread[i] == NULL)
-			{
-			cout<<"Thread creation Failed";
-			}
-			}
-			/* Waiting for threads to terminate */
-			WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
-			for(i=0;i<NUM_THREADS;i++)
-					CloseHandle( hThread[i] );
-
-		#else	
-			pthread_t thread[NUM_THREADS];
-			pthread_attr_t attr;
-			int rc, t;
+        try{
+                 int i;
+                 #ifdef WIN32
+                        /*Windows specific code comes here */
+                        HANDLE hThread[NUM_THREADS];
+                        for(i=0;i<NUM_THREADS;i++){
+                                        DWORD dwThreadId;
+                                        //LPVOID dwThrdParam = LPVOID(argv[1]);
+                                        hThread[i] = CreateThread(
+                                                                                        NULL,                        // no security attributes
+                                                                                        0,                           // use default stack size
+                                                                                        ThreadFunc,                  // thread function
+                                                                                        LPVOID(argv[1]),             // argument to thread function
+                                                                                        0,   
+                                                                                &dwThreadId);              // returns the thread identifier
+
+                        if (hThread[i] == NULL)
+                        {
+                        cout<<"Thread creation Failed";
+                        }
+                        }
+                        /* Waiting for threads to terminate */
+                        WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
+                        for(i=0;i<NUM_THREADS;i++)
+                                        CloseHandle( hThread[i] );
+
+                #else   
+                        pthread_t thread[NUM_THREADS];
+                        pthread_attr_t attr;
+                        int rc, t;
             void *status;
-		//   Initialize and set thread detached attribute
-			pthread_attr_init(&attr);
-			pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
-			for (t = 0; t < NUM_THREADS; t++)
-			{
-			/*Creating threads */
-				rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
-				if (rc)
-				{
-					cout<<"Thread Creation Failed";
-				}
-			}
-		//Free attribute and wait for the other threads
-		pthread_attr_destroy(&attr);
-		/* Wait for the threads to terminate  */
-		for(t=0;t<NUM_THREADS;t++){
-			rc = pthread_join(thread[t], &status);
-				if (rc)
-				{
-					cout<<"ERROR from pthread_join()"<<endl;
-				}
-		}
-	#endif
+                //   Initialize and set thread detached attribute
+                        pthread_attr_init(&attr);
+                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+                        for (t = 0; t < NUM_THREADS; t++)
+                        {
+                        /*Creating threads */
+                                rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
+                                if (rc)
+                                {
+                                        cout<<"Thread Creation Failed";
+                                }
+                        }
+                //Free attribute and wait for the other threads
+                pthread_attr_destroy(&attr);
+                /* Wait for the threads to terminate  */
+                for(t=0;t<NUM_THREADS;t++){
+                        rc = pthread_join(thread[t], &status);
+                                if (rc)
+                                {
+                                        cout<<"ERROR from pthread_join()"<<endl;
+                                }
+                }
+        #endif
   }catch(exception &e){
            cout<< e.what();
   }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestClient.cpp Thu Apr 27 20:03:51 2006
@@ -26,155 +26,155 @@
 
 int main(int argc, char* argv[])
 {
-	char endpoint[256];
-	const char* server="localhost";
-	const char* port="80";
-	const char* url="http://localhost:80/axis/MathOps";
-	const char* op = 0;
-	char* p1 = 0;
-	const char* p2 = 0;
-	int p3 = 0;
-	int i1=0, i2=0;
-	int iResult;
-	char* pcDetail;
-
-	signal(SIGILL, sig_handler);
-	signal(SIGABRT, sig_handler);
-	signal(SIGSEGV, sig_handler);
-	signal(SIGFPE, sig_handler);
-
-	if(argc>1)
-		url = argv[1];
-
-	op = "div";
-	
-	i1 = 10;
-	i2 = 5;
-
-	if (strcmp(op, "div") == 0)
-	{
-	    for(p3 = 0; p3 < 3; p3++)
-	    {
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
-
-		do
-		{
-		try
-		{     
-		    switch(p3)
-		    {
-			case 0:
-			    /* Sends a normal request. the result should be the division of
-			     *  two numbers the user has provided
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-			    sprintf(endpoint, "%s", url);
-			    break;
-	    
-			case 1:
-			    /* Service name is missing. The message
-			     *  Exception : AxisSoapException:Soap action is empty
-			     *  should be returned to the user.
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = strrchr(endpoint, '/');
-			    *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
-			    break;
-	  
-		       case 2: 
-			   /* Service name is wrong. The message
-			    * Exception : AxisWsddException:Requested service not found
-			    * should be returned to the user.
-			    */
-			    //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = endpoint + (strlen(endpoint) - 3);
-			    *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
-			    break;
-
-		       case 3:
-			     /* Service path is empty. The message  
-			      * The corresponding http fail message
-			      * should be returned to the user.
-			      */
-			    /*sprintf(endpoint, "http://%s:%s/", server, port);*/
-			    cout << "This test has been temporarily terminated"  
-			    << " due to an unresolved bug"<< endl;
-			    exit(0); /* This is temporary code*/
-			    break;
-
-		       case 4:
-			    /* Exception : AxisTransportException:Unexpected string
-			     * received. Most probably server returned an empty stream
-			     */
-			    sprintf(endpoint, "", server, port);
-			    //sprintf(endpoint, "http://%s:%s", server, port);
-			    break;
-		 
-		       default:
-			    cout << "Invalid option for the last parameter"<<endl<<endl;
-			    return 0;
-		    }
-		    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-		    MathOps ws(endpoint);
-		    iResult = ws.div(i1, i2);		
-		    cout << "Result is:" << iResult << endl;
-			bSuccess = true;
-		}
-		catch(AxisException& e)
-		{
-			bool bSilent = false;
-
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+        char endpoint[256];
+        const char* server="localhost";
+        const char* port="80";
+        const char* url="http://localhost:80/axis/MathOps";
+        const char* op = 0;
+        char* p1 = 0;
+        const char* p2 = 0;
+        int p3 = 0;
+        int i1=0, i2=0;
+        int iResult;
+        char* pcDetail;
+
+        signal(SIGILL, sig_handler);
+        signal(SIGABRT, sig_handler);
+        signal(SIGSEGV, sig_handler);
+        signal(SIGFPE, sig_handler);
+
+        if(argc>1)
+                url = argv[1];
+
+        op = "div";
+        
+        i1 = 10;
+        i2 = 5;
+
+        if (strcmp(op, "div") == 0)
+        {
+            for(p3 = 0; p3 < 3; p3++)
+            {
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
+
+                do
+                {
+                try
+                {     
+                    switch(p3)
+                    {
+                        case 0:
+                            /* Sends a normal request. the result should be the division of
+                             *  two numbers the user has provided
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                            sprintf(endpoint, "%s", url);
+                            break;
+            
+                        case 1:
+                            /* Service name is missing. The message
+                             *  Exception : AxisSoapException:Soap action is empty
+                             *  should be returned to the user.
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = strrchr(endpoint, '/');
+                            *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
+                            break;
+          
+                       case 2: 
+                           /* Service name is wrong. The message
+                            * Exception : AxisWsddException:Requested service not found
+                            * should be returned to the user.
+                            */
+                            //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = endpoint + (strlen(endpoint) - 3);
+                            *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
+                            break;
+
+                       case 3:
+                             /* Service path is empty. The message  
+                              * The corresponding http fail message
+                              * should be returned to the user.
+                              */
+                            /*sprintf(endpoint, "http://%s:%s/", server, port);*/
+                            cout << "This test has been temporarily terminated"  
+                            << " due to an unresolved bug"<< endl;
+                            exit(0); /* This is temporary code*/
+                            break;
+
+                       case 4:
+                            /* Exception : AxisTransportException:Unexpected string
+                             * received. Most probably server returned an empty stream
+                             */
+                            sprintf(endpoint, "", server, port);
+                            //sprintf(endpoint, "http://%s:%s", server, port);
+                            break;
+                 
+                       default:
+                            cout << "Invalid option for the last parameter"<<endl<<endl;
+                            return 0;
+                    }
+                    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                    MathOps ws(endpoint);
+                    iResult = ws.div(i1, i2);           
+                    cout << "Result is:" << iResult << endl;
+                        bSuccess = true;
+                }
+                catch(AxisException& e)
+                {
+                        bool bSilent = false;
+
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
-				cout << "AxisException has occured: " << e.what() << endl;
-			}
-		}
-		catch(exception& e)
-		{
-		    cout << "Unknown exception has occured"<< endl;
-		}
-		catch(...)
-		{
-		    cout << "Unspecified exception has occured" << endl;
-		}
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << op <<endl<<endl;
-		PrintUsage();
-	}
+                        {
+                                cout << "AxisException has occured: " << e.what() << endl;
+                        }
+                }
+                catch(exception& e)
+                {
+                    cout << "Unknown exception has occured"<< endl;
+                }
+                catch(...)
+                {
+                    cout << "Unspecified exception has occured" << endl;
+                }
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << op <<endl<<endl;
+                PrintUsage();
+        }
 
-	cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
-	return 0;
+        cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
+        return 0;
 }
 
 void PrintUsage()
 {
-	printf("Usage :\n MathOps <url>\n\n");
-	exit(1);
+        printf("Usage :\n MathOps <url>\n\n");
+        exit(1);
 }
 
 void sig_handler(int sig) {
-	signal(sig, sig_handler);
-	cout << "SIGNAL RECEIVED " << sig << endl;
-	exit(1);
+        signal(sig, sig_handler);
+        cout << "SIGNAL RECEIVED " << sig << endl;
+        exit(1);
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDocClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDocClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDocClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDocClient.cpp Thu Apr 27 20:03:51 2006
@@ -26,155 +26,155 @@
 
 int main(int argc, char* argv[])
 {
-	char endpoint[256];
-	const char* server="localhost";
-	const char* port="80";
-	const char* url="http://localhost:80/axis/MathOps";
-	const char* op = 0;
-	char* p1 = 0;
-	const char* p2 = 0;
-	int p3 = 0;
-	int i1=0, i2=0;
-	int iResult;
-	char* pcDetail;
-
-	signal(SIGILL, sig_handler);
-	signal(SIGABRT, sig_handler);
-	signal(SIGSEGV, sig_handler);
-	signal(SIGFPE, sig_handler);
-
-	if(argc>1)
-		url = argv[1];
-
-	op = "div";
-	
-	i1 = 10;
-	i2 = 5;
-
-	if (strcmp(op, "div") == 0)
-	{
-	    for(p3 = 0; p3 < 3; p3++)
-	    {
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
-
-		do
-		{
-		try
-		{     
-		    switch(p3)
-		    {
-			case 0:
-			    /* Sends a normal request. the result should be the division of
-			     *  two numbers the user has provided
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-			    sprintf(endpoint, "%s", url);
-			    break;
-	    
-			case 1:
-			    /* Service name is missing. The message
-			     *  Exception : AxisSoapException:Soap action is empty
-			     *  should be returned to the user.
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = strrchr(endpoint, '/');
-			    *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
-			    break;
-	  
-		       case 2: 
-			   /* Service name is wrong. The message
-			    * Exception : AxisWsddException:Requested service not found
-			    * should be returned to the user.
-			    */
-			    //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = endpoint + (strlen(endpoint) - 3);
-			    *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
-			    break;
-
-		       case 3:
-			     /* Service path is empty. The message  
-			      * The corresponding http fail message
-			      * should be returned to the user.
-			      */
-			    /*sprintf(endpoint, "http://%s:%s/", server, port);*/
-			    cout << "This test has been temporarily terminated"  
-			    << " due to an unresolved bug"<< endl;
-			    exit(0); /* This is temporary code*/
-			    break;
-
-		       case 4:
-			    /* Exception : AxisTransportException:Unexpected string
-			     * received. Most probably server returned an empty stream
-			     */
-			    sprintf(endpoint, "", server, port);
-			    //sprintf(endpoint, "http://%s:%s", server, port);
-			    break;
-		 
-		       default:
-			    cout << "Invalid option for the last parameter"<<endl<<endl;
-			    return 0;
-		    }
-		    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-		    MathOps ws(endpoint);
-		    iResult = ws.div(i1, i2);		
-		    cout << "Result is:" << iResult << endl;
-			bSuccess = true;
-		}
-		catch(AxisException& e)
-		{
-			bool bSilent = false;
-
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+        char endpoint[256];
+        const char* server="localhost";
+        const char* port="80";
+        const char* url="http://localhost:80/axis/MathOps";
+        const char* op = 0;
+        char* p1 = 0;
+        const char* p2 = 0;
+        int p3 = 0;
+        int i1=0, i2=0;
+        int iResult;
+        char* pcDetail;
+
+        signal(SIGILL, sig_handler);
+        signal(SIGABRT, sig_handler);
+        signal(SIGSEGV, sig_handler);
+        signal(SIGFPE, sig_handler);
+
+        if(argc>1)
+                url = argv[1];
+
+        op = "div";
+        
+        i1 = 10;
+        i2 = 5;
+
+        if (strcmp(op, "div") == 0)
+        {
+            for(p3 = 0; p3 < 3; p3++)
+            {
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
+
+                do
+                {
+                try
+                {     
+                    switch(p3)
+                    {
+                        case 0:
+                            /* Sends a normal request. the result should be the division of
+                             *  two numbers the user has provided
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                            sprintf(endpoint, "%s", url);
+                            break;
+            
+                        case 1:
+                            /* Service name is missing. The message
+                             *  Exception : AxisSoapException:Soap action is empty
+                             *  should be returned to the user.
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = strrchr(endpoint, '/');
+                            *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
+                            break;
+          
+                       case 2: 
+                           /* Service name is wrong. The message
+                            * Exception : AxisWsddException:Requested service not found
+                            * should be returned to the user.
+                            */
+                            //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = endpoint + (strlen(endpoint) - 3);
+                            *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
+                            break;
+
+                       case 3:
+                             /* Service path is empty. The message  
+                              * The corresponding http fail message
+                              * should be returned to the user.
+                              */
+                            /*sprintf(endpoint, "http://%s:%s/", server, port);*/
+                            cout << "This test has been temporarily terminated"  
+                            << " due to an unresolved bug"<< endl;
+                            exit(0); /* This is temporary code*/
+                            break;
+
+                       case 4:
+                            /* Exception : AxisTransportException:Unexpected string
+                             * received. Most probably server returned an empty stream
+                             */
+                            sprintf(endpoint, "", server, port);
+                            //sprintf(endpoint, "http://%s:%s", server, port);
+                            break;
+                 
+                       default:
+                            cout << "Invalid option for the last parameter"<<endl<<endl;
+                            return 0;
+                    }
+                    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                    MathOps ws(endpoint);
+                    iResult = ws.div(i1, i2);           
+                    cout << "Result is:" << iResult << endl;
+                        bSuccess = true;
+                }
+                catch(AxisException& e)
+                {
+                        bool bSilent = false;
+
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
-				cout << "AxisException has occured: " << e.what() << endl;
-			}
-		}
-		catch(exception& e)
-		{
-		    cout << "Unknown exception has occured"<< endl;
-		}
-		catch(...)
-		{
-		    cout << "Unspecified exception has occured" << endl;
-		}
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << op <<endl<<endl;
-		PrintUsage();
-	}
+                        {
+                                cout << "AxisException has occured: " << e.what() << endl;
+                        }
+                }
+                catch(exception& e)
+                {
+                    cout << "Unknown exception has occured"<< endl;
+                }
+                catch(...)
+                {
+                    cout << "Unspecified exception has occured" << endl;
+                }
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << op <<endl<<endl;
+                PrintUsage();
+        }
 
-	cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
-	return 0;
+        cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
+        return 0;
 }
 
 void PrintUsage()
 {
-	printf("Usage :\n MathOps <url>\n\n");
-	exit(1);
+        printf("Usage :\n MathOps <url>\n\n");
+        exit(1);
 }
 
 void sig_handler(int sig) {
-	signal(sig, sig_handler);
-	cout << "SIGNAL RECEIVED " << sig << endl;
-	exit(1);
+        signal(sig, sig_handler);
+        cout << "SIGNAL RECEIVED " << sig << endl;
+        exit(1);
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDoc_TTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDoc_TTestClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDoc_TTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExceptionTestDoc_TTestClient.cpp Thu Apr 27 20:03:51 2006
@@ -55,142 +55,142 @@
         /*Type casting the url to char * */
         char *p=(char *)Param;
         char endpoint[256];
-		const char* server="localhost";
-		const char* port="80";
+                const char* server="localhost";
+                const char* port="80";
         const char* url="http://localhost:80/ExceptionTest/services/MathOps";
         if(p!=NULL)
              url=p;
-	const char* op = 0;
-	char* p1 = 0;
-	const char* p2 = 0;
-	int p3 = 0;
-	int i1=0, i2=0;
-	int iResult;
-	char* pcDetail;
-
-	signal(SIGILL, sig_handler);
-	signal(SIGABRT, sig_handler);
-	signal(SIGSEGV, sig_handler);
-	signal(SIGFPE, sig_handler);	
-	op = "div";	
-	i1 = 10;
-	i2 = 5;
-	if (strcmp(op, "div") == 0)
-	{
-	    for(p3 = 0; p3 < 3; p3++)
-	    {
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
-
-		do
-		{
-		try
-		{     
-		    switch(p3)
-		    {
-			case 0:
-			    /* Sends a normal request. the result should be the division of
-			     *  two numbers the user has provided
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-			    sprintf(endpoint, "%s", url);
-			    break;
-	    
-			case 1:
-			    /* Service name is missing. The message
-			     *  Exception : AxisSoapException:Soap action is empty
-			     *  should be returned to the user.
-			     */
-			    //sprintf(endpoint, "http://%s:%s/axis", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = strrchr(endpoint, '/');
-			    *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
-			    break;
-	  
-		       case 2: 
-			   /* Service name is wrong. The message
-			    * Exception : AxisWsddException:Requested service not found
-			    * should be returned to the user.
-			    */
-			    //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
-			    sprintf(endpoint, "%s", url);
-			    p1 = endpoint + (strlen(endpoint) - 3);
-			    *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
-			    break;
-
-		       case 3:
-			     /* Service path is empty. The message  
-			      * The corresponding http fail message
-			      * should be returned to the user.
-			      */
-			    /*sprintf(endpoint, "http://%s:%s/", server, port);*/
-			    cout << "This test has been temporarily terminated"  
-			    << " due to an unresolved bug"<< endl;
-			    exit(0); /* This is temporary code*/
-			    break;
-
-		       case 4:
-			    /* Exception : AxisTransportException:Unexpected string
-			     * received. Most probably server returned an empty stream
-			     */
-			    sprintf(endpoint, "", server, port);
-			    //sprintf(endpoint, "http://%s:%s", server, port);
-			    break;
-		 
-		       default:
-			    cout << "Invalid option for the last parameter"<<endl<<endl;
-			    return 0;
-		    }
-		    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
-		    MathOps ws(endpoint);
-		    iResult = ws.div(i1, i2);		
-		    //cout << "Result is:" << iResult << endl;
-			bSuccess = true;
-
-		}
-		catch(AxisException& e)
-		{
-			bool bSilent = false;
-
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+        const char* op = 0;
+        char* p1 = 0;
+        const char* p2 = 0;
+        int p3 = 0;
+        int i1=0, i2=0;
+        int iResult;
+        char* pcDetail;
+
+        signal(SIGILL, sig_handler);
+        signal(SIGABRT, sig_handler);
+        signal(SIGSEGV, sig_handler);
+        signal(SIGFPE, sig_handler);    
+        op = "div";     
+        i1 = 10;
+        i2 = 5;
+        if (strcmp(op, "div") == 0)
+        {
+            for(p3 = 0; p3 < 3; p3++)
+            {
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
+
+                do
+                {
+                try
+                {     
+                    switch(p3)
+                    {
+                        case 0:
+                            /* Sends a normal request. the result should be the division of
+                             *  two numbers the user has provided
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                            sprintf(endpoint, "%s", url);
+                            break;
+            
+                        case 1:
+                            /* Service name is missing. The message
+                             *  Exception : AxisSoapException:Soap action is empty
+                             *  should be returned to the user.
+                             */
+                            //sprintf(endpoint, "http://%s:%s/axis", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = strrchr(endpoint, '/');
+                            *p1 = (char)NULL; // Set a NULL at the last '/' char to strip the service endpoint interface
+                            break;
+          
+                       case 2: 
+                           /* Service name is wrong. The message
+                            * Exception : AxisWsddException:Requested service not found
+                            * should be returned to the user.
+                            */
+                            //sprintf(endpoint, "http://%s:%s/axis/Math", server, port);
+                            sprintf(endpoint, "%s", url);
+                            p1 = endpoint + (strlen(endpoint) - 3);
+                            *p1 = (char)NULL; // Set a NULL to strip the last 3 chars
+                            break;
+
+                       case 3:
+                             /* Service path is empty. The message  
+                              * The corresponding http fail message
+                              * should be returned to the user.
+                              */
+                            /*sprintf(endpoint, "http://%s:%s/", server, port);*/
+                            cout << "This test has been temporarily terminated"  
+                            << " due to an unresolved bug"<< endl;
+                            exit(0); /* This is temporary code*/
+                            break;
+
+                       case 4:
+                            /* Exception : AxisTransportException:Unexpected string
+                             * received. Most probably server returned an empty stream
+                             */
+                            sprintf(endpoint, "", server, port);
+                            //sprintf(endpoint, "http://%s:%s", server, port);
+                            break;
+                 
+                       default:
+                            cout << "Invalid option for the last parameter"<<endl<<endl;
+                            return 0;
+                    }
+                    //sprintf(endpoint, "http://%s:%s/axis/MathOps", server, port);
+                    MathOps ws(endpoint);
+                    iResult = ws.div(i1, i2);           
+                    //cout << "Result is:" << iResult << endl;
+                        bSuccess = true;
+
+                }
+                catch(AxisException& e)
+                {
+                        bool bSilent = false;
+
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
-		   // cout << "AxisException has occured: " << e.what()<<endl;
-			}
-			if(p3==2)
-			{
-				cout << "Success" << endl;
-							bSuccess = true;
-			}
-		}
-		catch(exception& e)
-		{
-		    cout << "Unknown exception has occured"<< endl;
-		}
-		catch(...)
-		{
-		    cout << "Unspecified exception has occured" << endl;
-		}
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << op <<endl<<endl;
-		//PrintUsage();
-	} 
+                        {
+                   // cout << "AxisException has occured: " << e.what()<<endl;
+                        }
+                        if(p3==2)
+                        {
+                                cout << "Success" << endl;
+                                                        bSuccess = true;
+                        }
+                }
+                catch(exception& e)
+                {
+                    cout << "Unknown exception has occured"<< endl;
+                }
+                catch(...)
+                {
+                    cout << "Unspecified exception has occured" << endl;
+                }
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << op <<endl<<endl;
+                //PrintUsage();
+        } 
     #ifndef WIN32
             pthread_exit(0);
     #endif
@@ -203,60 +203,60 @@
 int main(int argc, char *argv[])
 {
     Axis::initialize(false);
-	try{
-		 int i;
-		 #ifdef WIN32
-			/*Windows specific code comes here */
-			HANDLE hThread[NUM_THREADS];
-			for(i=0;i<NUM_THREADS;i++){
-					DWORD dwThreadId;
-					//LPVOID dwThrdParam = LPVOID(argv[1]);
-					hThread[i] = CreateThread(
-											NULL,                        // no security attributes
-											0,                           // use default stack size
-											ThreadFunc,                  // thread function
-											LPVOID(argv[1]),             // argument to thread function
-											0,   
-										&dwThreadId);              // returns the thread identifier
-
-			if (hThread[i] == NULL)
-			{
-			cout<<"Thread creation Failed";
-			}
-			}
-			/* Waiting for threads to terminate */
-			WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
-			for(i=0;i<NUM_THREADS;i++)
-					CloseHandle( hThread[i] );
-
-		#else	
-			pthread_t thread[NUM_THREADS];
-			pthread_attr_t attr;
-			int rc, t;
+        try{
+                 int i;
+                 #ifdef WIN32
+                        /*Windows specific code comes here */
+                        HANDLE hThread[NUM_THREADS];
+                        for(i=0;i<NUM_THREADS;i++){
+                                        DWORD dwThreadId;
+                                        //LPVOID dwThrdParam = LPVOID(argv[1]);
+                                        hThread[i] = CreateThread(
+                                                                                        NULL,                        // no security attributes
+                                                                                        0,                           // use default stack size
+                                                                                        ThreadFunc,                  // thread function
+                                                                                        LPVOID(argv[1]),             // argument to thread function
+                                                                                        0,   
+                                                                                &dwThreadId);              // returns the thread identifier
+
+                        if (hThread[i] == NULL)
+                        {
+                        cout<<"Thread creation Failed";
+                        }
+                        }
+                        /* Waiting for threads to terminate */
+                        WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
+                        for(i=0;i<NUM_THREADS;i++)
+                                        CloseHandle( hThread[i] );
+
+                #else   
+                        pthread_t thread[NUM_THREADS];
+                        pthread_attr_t attr;
+                        int rc, t;
             void *status;
-		//   Initialize and set thread detached attribute
-			pthread_attr_init(&attr);
-			pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
-			for (t = 0; t < NUM_THREADS; t++)
-			{
-			/*Creating threads */
-				rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
-				if (rc)
-				{
-					cout<<"Thread Creation Failed";
-				}
-			}
-		//Free attribute and wait for the other threads
-		pthread_attr_destroy(&attr);
-		/* Wait for the threads to terminate  */
-		for(t=0;t<NUM_THREADS;t++){
-			rc = pthread_join(thread[t], &status);
-				if (rc)
-				{
-					cout<<"ERROR from pthread_join()"<<endl;
-				}
-		}
-	#endif
+                //   Initialize and set thread detached attribute
+                        pthread_attr_init(&attr);
+                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+                        for (t = 0; t < NUM_THREADS; t++)
+                        {
+                        /*Creating threads */
+                                rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
+                                if (rc)
+                                {
+                                        cout<<"Thread Creation Failed";
+                                }
+                        }
+                //Free attribute and wait for the other threads
+                pthread_attr_destroy(&attr);
+                /* Wait for the threads to terminate  */
+                for(t=0;t<NUM_THREADS;t++){
+                        rc = pthread_join(thread[t], &status);
+                                if (rc)
+                                {
+                                        cout<<"ERROR from pthread_join()"<<endl;
+                                }
+                }
+        #endif
   }catch(exception &e){
            cout<< e.what();
   }
@@ -264,9 +264,9 @@
 }
 
 void sig_handler(int sig) {
-	signal(sig, sig_handler);
-	cout << "SIGNAL RECEIVED " << sig << endl;
-	exit(1);
+        signal(sig, sig_handler);
+        cout << "SIGNAL RECEIVED " << sig << endl;
+        exit(1);
 }
 
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExtensibilityQueryClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExtensibilityQueryClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExtensibilityQueryClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ExtensibilityQueryClient.cpp Thu Apr 27 20:03:51 2006
@@ -29,50 +29,50 @@
     pAny->_array[1] = strdup("<getQuoteResponse xmlns=\"http://www.getquote.org/test\"><result><name>Widgets Inc.</name><symbol>WID</symbol><public>true</public></result></getQuoteResponse>");
 
     string str;
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
 
-		do
-		{
+                do
+                {
     try{
-	sprintf(endpoint, "%s", url);
+        sprintf(endpoint, "%s", url);
         ExtensibilityQueryPortType* pStub = new ExtensibilityQueryPortType(endpoint);
         AnyType* pAnyReturn = pStub->query(pAny);
-		if (!pAnyReturn)
-		{
-			printf("Returned AnyType is null\ntest failed\n");
-			exit(1);
-		}	
+                if (!pAnyReturn)
+                {
+                        printf("Returned AnyType is null\ntest failed\n");
+                        exit(1);
+                }       
         for (int i=0; i<pAnyReturn->_size; i++)
         {
-			printf("\nSent xml string: \n%s\n", pAny->_array[i]);
-			printf("\nReturned xml string: \n%s\n", pAnyReturn->_array[i]);
+                        printf("\nSent xml string: \n%s\n", pAny->_array[i]);
+                        printf("\nReturned xml string: \n%s\n", pAnyReturn->_array[i]);
         }
-		bSuccess = true;
+                bSuccess = true;
     }
     catch(AxisException& e)
     {
-			bool bSilent = false;
+                        bool bSilent = false;
 
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
+                        {
         printf("%s\n", e.getExceptionCode());
-			}
+                        }
     }
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
 
     return 0;
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingClient.cpp Thu Apr 27 20:03:51 2006
@@ -24,59 +24,59 @@
 
 typedef struct
 {
-	int	iValue1;
-	int	iValue2;
+        int     iValue1;
+        int     iValue2;
 } MathOperationData;
 
 int main( int argc, char * argv[])
 {
-	char *				pszURL = "http://localhost:80/axis/MathOps";
-	const char *		pszOperation = NULL;
-	MathOperationData	sMathOperationData[] = {{  10,  5},
-												{  10,  0},
-												{1000,  5},
-												{  10, -5},
-												{   0,  0}};
-
-	signal( SIGILL,  sig_handler);
-	signal( SIGABRT, sig_handler);
-	signal( SIGSEGV, sig_handler);
+        char *                          pszURL = "http://localhost:80/axis/MathOps";
+        const char *            pszOperation = NULL;
+        MathOperationData       sMathOperationData[] = {{  10,  5},
+                                                                                                {  10,  0},
+                                                                                                {1000,  5},
+                                                                                                {  10, -5},
+                                                                                                {   0,  0}};
+
+        signal( SIGILL,  sig_handler);
+        signal( SIGABRT, sig_handler);
+        signal( SIGSEGV, sig_handler);
 //  signal( SIGQUIT, sig_handler);
 //  signal( SIGBUS,  sig_handler);
-	signal( SIGFPE,  sig_handler);
+        signal( SIGFPE,  sig_handler);
 
-	pszURL = argv[1];
+        pszURL = argv[1];
 
-	pszOperation = "div";
+        pszOperation = "div";
 
-	if( strcmp( pszOperation, "div") == 0)
-	{
-	    int	iMathDataCount = 0;
+        if( strcmp( pszOperation, "div") == 0)
+        {
+            int iMathDataCount = 0;
 
-		while( sMathOperationData[iMathDataCount].iValue1 != 0 &&
-			   sMathOperationData[iMathDataCount].iValue1 != sMathOperationData[iMathDataCount].iValue2)
-	    {
-			bool bSuccess = false;
-			int	iRetryIterationCount = 3;
+                while( sMathOperationData[iMathDataCount].iValue1 != 0 &&
+                           sMathOperationData[iMathDataCount].iValue1 != sMathOperationData[iMathDataCount].iValue2)
+            {
+                        bool bSuccess = false;
+                        int     iRetryIterationCount = 3;
 
             cout << iMathDataCount << endl;
 
-			do
-			{
-				try
-				{
-					MathOps	ws( pszURL);
-
-					if( iRetryIterationCount == 3)
-					{
-						cout << "Trying to "
-							 << pszOperation
-							 << " "
-							 << sMathOperationData[iMathDataCount].iValue1
-							 << " by "
-							 << sMathOperationData[iMathDataCount].iValue2
-							 << endl;
-					}
+                        do
+                        {
+                                try
+                                {
+                                        MathOps ws( pszURL);
+
+                                        if( iRetryIterationCount == 3)
+                                        {
+                                                cout << "Trying to "
+                                                         << pszOperation
+                                                         << " "
+                                                         << sMathOperationData[iMathDataCount].iValue1
+                                                         << " by "
+                                                         << sMathOperationData[iMathDataCount].iValue2
+                                                         << endl;
+                                        }
 
 // HTTP/1.1 500 Internal Server Error
 // :
@@ -96,102 +96,102 @@
 //           xmlns="">
 // <varString xsi:type="xsd:string">Division by zero exception</varString>
 
-					int	iResult = ws.div( sMathOperationData[iMathDataCount].iValue1,
-										  sMathOperationData[iMathDataCount].iValue2);
-				
-					cout << "Result is " << iResult << endl;
-				
-					bSuccess = true;
-				}
-				catch( DivByZeroStruct& dbzs)
-				{
-					cout << "DivByZeroStruct Fault: \""
-						 << dbzs.varString
-						 << "\", "
-						 << dbzs.varInt
-						 << ", "
-						 << dbzs.varFloat
-						 << endl;
-
-					bSuccess = true;
-				}
-				catch( SpecialDetailStruct& sds)
-				{
-					cout << "SpecialDetailStruct Fault: \""
-						 << sds.varString
-						 << "\""
-						 << endl;
-
-					bSuccess = true;
-				}
-				catch( OutOfBoundStruct& oobs)
-				{
-					cout << "OutOfBoundStruct Fault: \""
-						 << oobs.varString
-						 << "\", "
-						 << oobs.varInt
-						 << ", \""
-						 << oobs.specialDetail->varString
-						 << "\""
-						 << endl;
-
-					bSuccess = true;
-				}
-				catch( SoapFaultException& sfe)
-				{
-					cout << "SoapFaultException: " << sfe.what() << endl;
-				}
-				catch( AxisException& e)
-				{
-					bool bSilent = false;
-
-					if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-					{
-						if( iRetryIterationCount > 1)
-						{
-							bSilent = true;
-						}
-					}
-					else
-					{
-						iRetryIterationCount = 0;
-					}
-
-		            if( !bSilent)
-					{
-						cout << "Exception : " << e.what() << endl;
-					}
-				}
-				catch( exception& e)
-				{
-		            cout << "Unknown Exception: " << e.what() << endl;
-				}
-				catch(...)
-				{
-		            cout << "Unspecified Exception: " << endl;
-				}
-
-				iRetryIterationCount--;
-			} while( iRetryIterationCount > 0 && !bSuccess);
-
-			iMathDataCount++;
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << pszOperation << endl;
-	}
-
-	cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
-	
-	return 0;
+                                        int     iResult = ws.div( sMathOperationData[iMathDataCount].iValue1,
+                                                                                  sMathOperationData[iMathDataCount].iValue2);
+                                
+                                        cout << "Result is " << iResult << endl;
+                                
+                                        bSuccess = true;
+                                }
+                                catch( DivByZeroStruct& dbzs)
+                                {
+                                        cout << "DivByZeroStruct Fault: \""
+                                                 << dbzs.varString
+                                                 << "\", "
+                                                 << dbzs.varInt
+                                                 << ", "
+                                                 << dbzs.varFloat
+                                                 << endl;
+
+                                        bSuccess = true;
+                                }
+                                catch( SpecialDetailStruct& sds)
+                                {
+                                        cout << "SpecialDetailStruct Fault: \""
+                                                 << sds.varString
+                                                 << "\""
+                                                 << endl;
+
+                                        bSuccess = true;
+                                }
+                                catch( OutOfBoundStruct& oobs)
+                                {
+                                        cout << "OutOfBoundStruct Fault: \""
+                                                 << oobs.varString
+                                                 << "\", "
+                                                 << oobs.varInt
+                                                 << ", \""
+                                                 << oobs.specialDetail->varString
+                                                 << "\""
+                                                 << endl;
+
+                                        bSuccess = true;
+                                }
+                                catch( SoapFaultException& sfe)
+                                {
+                                        cout << "SoapFaultException: " << sfe.what() << endl;
+                                }
+                                catch( AxisException& e)
+                                {
+                                        bool bSilent = false;
+
+                                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                                        {
+                                                if( iRetryIterationCount > 1)
+                                                {
+                                                        bSilent = true;
+                                                }
+                                        }
+                                        else
+                                        {
+                                                iRetryIterationCount = 0;
+                                        }
+
+                            if( !bSilent)
+                                        {
+                                                cout << "Exception : " << e.what() << endl;
+                                        }
+                                }
+                                catch( exception& e)
+                                {
+                            cout << "Unknown Exception: " << e.what() << endl;
+                                }
+                                catch(...)
+                                {
+                            cout << "Unspecified Exception: " << endl;
+                                }
+
+                                iRetryIterationCount--;
+                        } while( iRetryIterationCount > 0 && !bSuccess);
+
+                        iMathDataCount++;
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << pszOperation << endl;
+        }
+
+        cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
+        
+        return 0;
 }
 
 void sig_handler( int sig)
 {
-	signal( sig, sig_handler);
+        signal( sig, sig_handler);
 
     cout << "SIGNAL RECEIVED " << sig << endl;
 
-	exit(1);
+        exit(1);
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp Thu Apr 27 20:03:51 2006
@@ -24,137 +24,137 @@
 
 int main(int argc, char* argv[])
 {
-	char endpoint[256];
-	const char* server="localhost";
-	const char* url="http://localhost:80/axis/MathOps";
-	const char* port="80";
-	const char* op = 0;
-	const char* p1 = 0;
-	const char* p2 = 0;
-	int i1=0, i2=0;
-	int iResult;
-	char* pcDetail;
-
-	signal(SIGILL, sig_handler);
-	signal(SIGABRT, sig_handler);
-	signal(SIGSEGV, sig_handler);
-	//signal(SIGQUIT, sig_handler);
-	//signal(SIGBUS, sig_handler);
-	signal(SIGFPE, sig_handler);
-
-	url = argv[1];
-
-	sprintf(endpoint, "%s", url);
-
-	op = "div";
-
-	if (strcmp(op, "div") == 0)
-	{
-	    for(int i = 0; i < 4; i++)
-	    {
+        char endpoint[256];
+        const char* server="localhost";
+        const char* url="http://localhost:80/axis/MathOps";
+        const char* port="80";
+        const char* op = 0;
+        const char* p1 = 0;
+        const char* p2 = 0;
+        int i1=0, i2=0;
+        int iResult;
+        char* pcDetail;
+
+        signal(SIGILL, sig_handler);
+        signal(SIGABRT, sig_handler);
+        signal(SIGSEGV, sig_handler);
+        //signal(SIGQUIT, sig_handler);
+        //signal(SIGBUS, sig_handler);
+        signal(SIGFPE, sig_handler);
+
+        url = argv[1];
+
+        sprintf(endpoint, "%s", url);
+
+        op = "div";
+
+        if (strcmp(op, "div") == 0)
+        {
+            for(int i = 0; i < 4; i++)
+            {
             cout << i << endl;
 
-			switch(i)
-			{
-				case 0: i1 = 10; i2 = 5; break;
-				case 1: i1 = 10; i2 = 0; break;
-				case 2: i1 = 1000; i2 = 5; break;
-				case 3: i1 = 10; i2 = -5; break;
-			}
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
-
-		do
-		{
-			try
-			{
-				MathOps ws(endpoint);
-				if( iRetryIterationCount == 3)
-					cout << "Trying to " << op << " " << i1 << " by " << i2 << endl;
-				iResult = ws.div(i1, i2);		
-				cout << "Result is " << iResult << endl;
-				bSuccess = true;
-			}
-			catch(DivByZeroStruct& dbzs)
-			{
-				cout << "DivByZeroStruct Fault: \"" 
-					<< dbzs.varString 
-					<< "\", " 
-					<< dbzs.varInt 
-					<< ", " 
-					<< dbzs.varFloat 
-					<< endl; 
-				bSuccess = true;
-			}
-			catch(SpecialDetailStruct& sds)
-			{
-				cout << "SpecialDetailStruct Fault: \"" 
-					<< sds.varString 
-					<< "\"" 
-					<< endl;
-				bSuccess = true;
-			}
-			catch(OutOfBoundStruct& oobs)
-			{
-				cout << "OutOfBoundStruct Fault: \"" 
-					<< oobs.varString 
-					<< "\", " 
-					<< oobs.varInt 
-					<< ", \"" 
-					<< oobs.specialDetail->varString 
-					<< "\"" 
-					<< endl;
-				bSuccess = true;
-			}
-			catch(SoapFaultException& sfe)
-			{
-				cout << "SoapFaultException: " << sfe.what() << endl;
-			}
-			catch(AxisException& e)
-			{
-			bool bSilent = false;
-
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+                        switch(i)
+                        {
+                                case 0: i1 = 10; i2 = 5; break;
+                                case 1: i1 = 10; i2 = 0; break;
+                                case 2: i1 = 1000; i2 = 5; break;
+                                case 3: i1 = 10; i2 = -5; break;
+                        }
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
+
+                do
+                {
+                        try
+                        {
+                                MathOps ws(endpoint);
+                                if( iRetryIterationCount == 3)
+                                        cout << "Trying to " << op << " " << i1 << " by " << i2 << endl;
+                                iResult = ws.div(i1, i2);               
+                                cout << "Result is " << iResult << endl;
+                                bSuccess = true;
+                        }
+                        catch(DivByZeroStruct& dbzs)
+                        {
+                                cout << "DivByZeroStruct Fault: \"" 
+                                        << dbzs.varString 
+                                        << "\", " 
+                                        << dbzs.varInt 
+                                        << ", " 
+                                        << dbzs.varFloat 
+                                        << endl; 
+                                bSuccess = true;
+                        }
+                        catch(SpecialDetailStruct& sds)
+                        {
+                                cout << "SpecialDetailStruct Fault: \"" 
+                                        << sds.varString 
+                                        << "\"" 
+                                        << endl;
+                                bSuccess = true;
+                        }
+                        catch(OutOfBoundStruct& oobs)
+                        {
+                                cout << "OutOfBoundStruct Fault: \"" 
+                                        << oobs.varString 
+                                        << "\", " 
+                                        << oobs.varInt 
+                                        << ", \"" 
+                                        << oobs.specialDetail->varString 
+                                        << "\"" 
+                                        << endl;
+                                bSuccess = true;
+                        }
+                        catch(SoapFaultException& sfe)
+                        {
+                                cout << "SoapFaultException: " << sfe.what() << endl;
+                        }
+                        catch(AxisException& e)
+                        {
+                        bool bSilent = false;
+
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
-				cout << "Exception : " << e.what() << endl;
-			}
-			}
-			catch(exception& e)
-			{
+                        {
+                                cout << "Exception : " << e.what() << endl;
+                        }
+                        }
+                        catch(exception& e)
+                        {
                 cout << "Unknown Exception: " << endl;
-			}
-			catch(...)
-			{
+                        }
+                        catch(...)
+                        {
                 cout << "Unspecified Exception: " << endl;
-			}
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << op << endl;
-	}
-	cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
-	
-	return 0;
+                        }
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << op << endl;
+        }
+        cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
+        
+        return 0;
 }
 
 void sig_handler(int sig) {
-	signal(sig, sig_handler);
+        signal(sig, sig_handler);
     cout << "SIGNAL RECEIVED " << sig << endl;
-	exit(1);
+        exit(1);
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDoc_TTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDoc_TTestClient.cpp?rev=397747&r1=397746&r2=397747&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDoc_TTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/FaultMappingDoc_TTestClient.cpp Thu Apr 27 20:03:51 2006
@@ -54,131 +54,131 @@
 {
         /*Type casting the url to char * */
     char endpoint[256];
-	const char* server="localhost";
-	const char* url="http://localhost:80/axis/MathOps";
-	const char* port="80";
-	const char* op = 0;
-	const char* p1 = 0;
-	const char* p2 = 0;
-	int i1=0, i2=0;
-	int iResult;
-	char* pcDetail;
-
-	signal(SIGILL, sig_handler);
-	signal(SIGABRT, sig_handler);
-	signal(SIGSEGV, sig_handler);
-	//signal(SIGQUIT, sig_handler);
-	//signal(SIGBUS, sig_handler);
-	signal(SIGFPE, sig_handler);
-
-	url = (char *)Param;
-
-	sprintf(endpoint, "%s", url);
-
-	op = "div";
-
-	if (strcmp(op, "div") == 0)
-	{
-	    for(int i = 0; i < 4; i++)
-	    {
+        const char* server="localhost";
+        const char* url="http://localhost:80/axis/MathOps";
+        const char* port="80";
+        const char* op = 0;
+        const char* p1 = 0;
+        const char* p2 = 0;
+        int i1=0, i2=0;
+        int iResult;
+        char* pcDetail;
+
+        signal(SIGILL, sig_handler);
+        signal(SIGABRT, sig_handler);
+        signal(SIGSEGV, sig_handler);
+        //signal(SIGQUIT, sig_handler);
+        //signal(SIGBUS, sig_handler);
+        signal(SIGFPE, sig_handler);
+
+        url = (char *)Param;
+
+        sprintf(endpoint, "%s", url);
+
+        op = "div";
+
+        if (strcmp(op, "div") == 0)
+        {
+            for(int i = 0; i < 4; i++)
+            {
            // cout << i << endl;
 
-			switch(i)
-			{
-				case 0: i1 = 10; i2 = 5; break;
-				case 1: i1 = 10; i2 = 0; break;
-				case 2: i1 = 1000; i2 = 5; break;
-				case 3: i1 = 10; i2 = -5; break;
-			}
-		bool bSuccess = false;
-		int	iRetryIterationCount = 3;
-
-		do
-		{
-			try
-			{
-				MathOps ws(endpoint);
-				//cout << "Trying to " << op << " " << i1 << " by " << i2 << endl;
-				iResult = ws.div(i1, i2);		
-				//cout << "Result is " << iResult << endl;
-				bSuccess = true;
-			}
-			catch(DivByZeroStruct& dbzs)
-			{
-				/*cout << "DivByZeroStruct Fault: \"" 
-					<< dbzs.varString 
-					<< "\", " 
-					<< dbzs.varInt 
-					<< ", " 
-					<< dbzs.varFloat 
-					<< endl; */
-					  bSuccess = true;
-			}
-			catch(SpecialDetailStruct& sds)
-			{
-				/*cout << "SpecialDetailStruct Fault: \"" 
-					<< sds.varString 
-					<< "\"" 
-					<< endl;*/
-					  bSuccess = true;
-			}
-			catch(OutOfBoundStruct& oobs)
-			{
-				/*cout << "OutOfBoundStruct Fault: \"" 
-					<< oobs.varString 
-					<< "\", " 
-					<< oobs.varInt 
-					<< ", \"" 
-					<< oobs.specialDetail->varString 
-					<< "\"" 
-					<< endl;*/
-				  if(i==3)
-				  {
-					  cout<<"Success"<<endl;
-				  }
-					  bSuccess = true;
-			}
-			catch(SoapFaultException& sfe)
-			{
-				cout << "SoapFaultException: " << sfe.what() << endl;
-			}
-			catch(AxisException& e)
-			{
-			bool bSilent = false;
-
-			if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
-			{
-				if( iRetryIterationCount > 0)
-				{
-					bSilent = true;
-				}
-			}
-			else
-			{
-				iRetryIterationCount = 0;
-			}
+                        switch(i)
+                        {
+                                case 0: i1 = 10; i2 = 5; break;
+                                case 1: i1 = 10; i2 = 0; break;
+                                case 2: i1 = 1000; i2 = 5; break;
+                                case 3: i1 = 10; i2 = -5; break;
+                        }
+                bool bSuccess = false;
+                int     iRetryIterationCount = 3;
+
+                do
+                {
+                        try
+                        {
+                                MathOps ws(endpoint);
+                                //cout << "Trying to " << op << " " << i1 << " by " << i2 << endl;
+                                iResult = ws.div(i1, i2);               
+                                //cout << "Result is " << iResult << endl;
+                                bSuccess = true;
+                        }
+                        catch(DivByZeroStruct& dbzs)
+                        {
+                                /*cout << "DivByZeroStruct Fault: \"" 
+                                        << dbzs.varString 
+                                        << "\", " 
+                                        << dbzs.varInt 
+                                        << ", " 
+                                        << dbzs.varFloat 
+                                        << endl; */
+                                          bSuccess = true;
+                        }
+                        catch(SpecialDetailStruct& sds)
+                        {
+                                /*cout << "SpecialDetailStruct Fault: \"" 
+                                        << sds.varString 
+                                        << "\"" 
+                                        << endl;*/
+                                          bSuccess = true;
+                        }
+                        catch(OutOfBoundStruct& oobs)
+                        {
+                                /*cout << "OutOfBoundStruct Fault: \"" 
+                                        << oobs.varString 
+                                        << "\", " 
+                                        << oobs.varInt 
+                                        << ", \"" 
+                                        << oobs.specialDetail->varString 
+                                        << "\"" 
+                                        << endl;*/
+                                  if(i==3)
+                                  {
+                                          cout<<"Success"<<endl;
+                                  }
+                                          bSuccess = true;
+                        }
+                        catch(SoapFaultException& sfe)
+                        {
+                                cout << "SoapFaultException: " << sfe.what() << endl;
+                        }
+                        catch(AxisException& e)
+                        {
+                        bool bSilent = false;
+
+                        if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+                        {
+                                if( iRetryIterationCount > 0)
+                                {
+                                        bSilent = true;
+                                }
+                        }
+                        else
+                        {
+                                iRetryIterationCount = 0;
+                        }
 
             if( !bSilent)
-			{
+                        {
                 cout << "AxisException: " << e.what() << endl;
-				}
-			}
-			catch(exception& e)
-			{
+                                }
+                        }
+                        catch(exception& e)
+                        {
                 cout << "Unknown Exception: " << endl;
-			}
-			catch(...)
-			{
+                        }
+                        catch(...)
+                        {
                 cout << "Unspecified Exception: " << endl;
-			}
-		iRetryIterationCount--;
-		} while( iRetryIterationCount > 0 && !bSuccess);
-	    }
-	}
-	else 
-	{
-		cout << "Invalid operation " << op << endl;
-	}
+                        }
+                iRetryIterationCount--;
+                } while( iRetryIterationCount > 0 && !bSuccess);
+            }
+        }
+        else 
+        {
+                cout << "Invalid operation " << op << endl;
+        }
     #ifndef WIN32
             pthread_exit(0);
     #endif
@@ -191,60 +191,60 @@
 int main(int argc, char *argv[])
 {
     Axis::initialize(false);
-	try{
-		 int i;
-		 #ifdef WIN32
-			/*Windows specific code comes here */
-			HANDLE hThread[NUM_THREADS];
-			for(i=0;i<NUM_THREADS;i++){
-					DWORD dwThreadId;
-					//LPVOID dwThrdParam = LPVOID(argv[1]);
-					hThread[i] = CreateThread(
-											NULL,                        // no security attributes
-											0,                           // use default stack size
-											ThreadFunc,                  // thread function
-											LPVOID(argv[1]),             // argument to thread function
-											0,   
-										&dwThreadId);              // returns the thread identifier
-
-			if (hThread[i] == NULL)
-			{
-			cout<<"Thread creation Failed";
-			}
-			}
-			/* Waiting for threads to terminate */
-			WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
-			for(i=0;i<NUM_THREADS;i++)
-					CloseHandle( hThread[i] );
-
-		#else	
-			pthread_t thread[NUM_THREADS];
-			pthread_attr_t attr;
-			int rc, t;
+        try{
+                 int i;
+                 #ifdef WIN32
+                        /*Windows specific code comes here */
+                        HANDLE hThread[NUM_THREADS];
+                        for(i=0;i<NUM_THREADS;i++){
+                                        DWORD dwThreadId;
+                                        //LPVOID dwThrdParam = LPVOID(argv[1]);
+                                        hThread[i] = CreateThread(
+                                                                                        NULL,                        // no security attributes
+                                                                                        0,                           // use default stack size
+                                                                                        ThreadFunc,                  // thread function
+                                                                                        LPVOID(argv[1]),             // argument to thread function
+                                                                                        0,   
+                                                                                &dwThreadId);              // returns the thread identifier
+
+                        if (hThread[i] == NULL)
+                        {
+                        cout<<"Thread creation Failed";
+                        }
+                        }
+                        /* Waiting for threads to terminate */
+                        WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
+                        for(i=0;i<NUM_THREADS;i++)
+                                        CloseHandle( hThread[i] );
+
+                #else   
+                        pthread_t thread[NUM_THREADS];
+                        pthread_attr_t attr;
+                        int rc, t;
             void *status;
-		//   Initialize and set thread detached attribute
-			pthread_attr_init(&attr);
-			pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
-			for (t = 0; t < NUM_THREADS; t++)
-			{
-			/*Creating threads */
-				rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
-				if (rc)
-				{
-					cout<<"Thread Creation Failed";
-				}
-			}
-		//Free attribute and wait for the other threads
-		pthread_attr_destroy(&attr);
-		/* Wait for the threads to terminate  */
-		for(t=0;t<NUM_THREADS;t++){
-			rc = pthread_join(thread[t], &status);
-				if (rc)
-				{
-					cout<<"ERROR from pthread_join()"<<endl;
-				}
-		}
-	#endif
+                //   Initialize and set thread detached attribute
+                        pthread_attr_init(&attr);
+                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+                        for (t = 0; t < NUM_THREADS; t++)
+                        {
+                        /*Creating threads */
+                                rc = pthread_create(&thread[t], &attr, ThreadFunc,(void *)argv[1]);
+                                if (rc)
+                                {
+                                        cout<<"Thread Creation Failed";
+                                }
+                        }
+                //Free attribute and wait for the other threads
+                pthread_attr_destroy(&attr);
+                /* Wait for the threads to terminate  */
+                for(t=0;t<NUM_THREADS;t++){
+                        rc = pthread_join(thread[t], &status);
+                                if (rc)
+                                {
+                                        cout<<"ERROR from pthread_join()"<<endl;
+                                }
+                }
+        #endif
   }catch(exception &e){
            cout<< e.what();
   }
@@ -252,9 +252,9 @@
 }
 
 void sig_handler(int sig) {
-	signal(sig, sig_handler);
-	cout << "SIGNAL RECEIVED " << sig << endl;
-	exit(1);
+        signal(sig, sig_handler);
+        cout << "SIGNAL RECEIVED " << sig << endl;
+        exit(1);
 }
 
 



Mime
View raw message