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 pe...@apache.org on 2005/01/06 17:57:12 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/client/cpp FaultMappingDocClient.cpp

perryan     2005/01/06 08:57:12

  Modified:    c/tests/auto_build/testcases/client/cpp
                        FaultMappingDocClient.cpp
  Log:
  Added a signal trap to capture the sigsegv which is being thrown when this test is run.
  
  Revision  Changes    Path
  1.8       +14 -9     ws-axis/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp
  
  Index: FaultMappingDocClient.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/FaultMappingDocClient.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FaultMappingDocClient.cpp	30 Nov 2004 13:45:24 -0000	1.7
  +++ FaultMappingDocClient.cpp	6 Jan 2005 16:57:11 -0000	1.8
  @@ -1,10 +1,11 @@
   #include "MathOps.hpp"
   #include <axis/AxisException.hpp>
   #include <ctype.h>
  +#include <signal.h>
   #include <iostream>
   
  +void sig_handler(int);
   void PrintUsage();
  -bool IsNumber(const char* p);
   
   int main(int argc, char* argv[])
   {
  @@ -19,11 +20,17 @@
   	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)
  @@ -94,11 +101,9 @@
   	exit(1);
   }
   
  -bool IsNumber(const char* p)
  -{
  -	for (int x=1; x < strlen(p); x++)
  -	{
  -		if (!isdigit(p[x])) return false;
  -	}
  -	return true;
  +void sig_handler(int sig) {
  +	signal(sig, sig_handler);
  +	printf("SIGNAL RECEIVED (%d)\n", sig);
  +	exit(1);
   }
  +