[Kst] branches/work/kst/1.5/kst/tests

Andrew Walker arwalker at sumusltd.com
Mon Sep 17 23:35:14 CEST 2007


SVN commit 713614 by arwalker:

allow for rounding errors when performing equality checks

 M  +4 -5      testeqparser.cpp  


--- branches/work/kst/1.5/kst/tests/testeqparser.cpp #713613:713614
@@ -302,9 +302,9 @@
   test("cos(0.0)", 0.0, 1.0);
   test("cos(3.14159265358979323)", 0.0, -1.0);
   test("cos(3.14159265358979323/2.00000000000000000000000000)", 0.0, 0.0);
-  test("sec(x) == 1/cos(x)", 0.2332744, 1.0);
-  test("csc(x) == 1/sin(x)", 0.2332744, 1.0);
-  test("cot(x) == 1/tan(x)", 0.2332744, 1.0);
+  test("abs(sec(x) - 1/cos(x)) < 0.000000001", 0.2332744, 1.0);
+  test("abs(csc(x) - 1/sin(x)) < 0.000000001", 0.2332744, 1.0);
+  test("abs(cot(x) - 1/tan(x)) < 0.000000001", 0.2332744, 1.0);
 
   test("abs(0.0)", 0.0, 0.0);
   test("abs(x)", 1.0, 1.0);
@@ -471,8 +471,7 @@
   test("-([V1]*sin([V1]*[V2])+[V3]*cos([V3]*[V3]))", 0.0, 0.0);
   test("[V3] * -1", 0.0, 0.0);
 
-  /*  Wrap a testcase with this and run bison with -t in order to get a trace
-   *  of the parse stack */
+  // Wrap a testcase with this and run bison with -t in order to get a trace of the parse stack
 #if 0
   yydebug = 1;
   yydebug = 0;


More information about the Kst mailing list