[Kst] kdeextragear-2/kst/tests

Barth Netterfield netterfield at astro.utoronto.ca
Tue Dec 21 18:02:54 CET 2004


CVS commit by netterfield: 

Updated histogram test.


  M +8 -7      testhistogram.cpp   1.7


--- kdeextragear-2/kst/tests/testhistogram.cpp  #1.6:1.7
@@ -94,19 +94,20 @@ void doTests() {
   doTest(h1->vMax() == 10.0);
   doTest(h1->vNumSamples() == 100);
-  // min-max < 2
-  h1 = new KstHistogram("H4", vp, 9, 10.999999, 1, KST_HS_NUMBER);
+  // max < min
+  h1 = new KstHistogram("H4", vp, 11, 9, 1, KST_HS_NUMBER);
   doTest(h1->type() == KST_HISTOGRAM);
   doTest(h1->nBins() == 2);
-  // the following test fails:  why should it pass?
-  doTest(h1->xMax() - h1->xMin() >= 2.0);
+  doTest(h1->xMax()==11);
+  doTest(h1->xMin()==9);
   doTest(h1->vMin() == 0.0);
   doTest(h1->vMax() == 10.0);
   doTest(h1->vNumSamples() == 100);
+  // set to max == min
   h1->setXRange(10, 10);
   doTest(h1->xMin() == 9.0);
   doTest(h1->xMax() == 11.0);
-  h1->setXRange(9, 10.999999999);
-  // the following test fails:  why should it pass?
-  doTest(h1->xMax() - h1->xMin() >= 2.0);
+  // set to max > min
+  h1->setXRange(1,2);
+  doTest(h1->xMax() - h1->xMin() ==1.0);
   h1->setXRange(8, 10);
   doTest(h1->xMin() == 8.0);




More information about the Kst mailing list