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 sa...@apache.org on 2005/06/16 10:09:54 UTC
cvs commit: ws-axis/c/tests/auto_build/testcases/server/cpp MathOps.cpp
samisa 2005/06/16 01:09:54
Modified: c/tests/auto_build/testcases/server/cpp MathOps.cpp
Log:
Added logic to handle div by zero case
Revision Changes Path
1.4 +11 -0 ws-axis/c/tests/auto_build/testcases/server/cpp/MathOps.cpp
Index: MathOps.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/server/cpp/MathOps.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MathOps.cpp 23 Mar 2005 15:45:10 -0000 1.3
+++ MathOps.cpp 16 Jun 2005 08:09:54 -0000 1.4
@@ -48,5 +48,16 @@
}
xsd__int MathOps::div(xsd__int Value0, xsd__int Value1)
{
+ if (Value1 == 0)
+ {
+ DivByZeroStruct* pObjFault = new DivByZeroStruct();
+ if(pObjFault)
+ {
+ pObjFault->varString = "Division by zero exception";
+ pObjFault->varInt = 1;
+ pObjFault->varFloat = 10.52;
+ throw pObjFault;
+ }
+ }
return (Value0/Value1);
}