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

Andrew Walker arwalker at sumusltd.com
Tue Sep 18 02:04:00 CEST 2007


SVN commit 713670 by arwalker:

better handle tests for resizing of a matrix

 M  +7 -2      testmatrix.cpp  


--- branches/work/kst/1.5/kst/tests/testmatrix.cpp #713669:713670
@@ -98,6 +98,11 @@
   doTest(um1->setValue(1, 1, 1.0));
   doTest(um1->setValue(2, 2, 1.0));
 
+  // calling resize on a matrix does not retain the correct values
+  // for matrix entries. i.e. taking a 3x3 matrix and resizing
+  // to a 2x2 matrix does not mean matrix[0][0], matrix[0][1],
+  // matrix[1][0], matrix[1][1] are the same before and after the resize.
+  // The resulting values should properly be undefined...
   doTest(um1->resize(2, 2, true));
   doTest(um1->sampleCount() == 4); 
 
@@ -109,7 +114,7 @@
   doTest(!ok);
   doTest(um1->value(1, 0, &ok) == 0);
   doTest(ok);
-  doTest(um1->value(1, 1, &ok) == 1.0);
+  doTest(um1->value(1, 1, &ok) == 0);
   doTest(ok);
   doTest(um1->value(1, 2, &ok) == 0);
   doTest(!ok);
@@ -123,7 +128,7 @@
   doTest(ok);
   doTest(um1->value(1, 0, &ok) == 0);
   doTest(ok);
-  doTest(um1->value(1, 1, &ok) == 1.0);
+  doTest(um1->value(1, 1, &ok) == 0);
   doTest(ok);
   doTest(um1->value(1, 2, &ok) == 0);
   doTest(ok);


More information about the Kst mailing list