[Kst] branches/work/kst/portto4/kst

Mike Fenton mike at staikos.net
Fri Nov 16 17:44:14 CET 2007


SVN commit 737576 by fenton:

Add Test for Generated Matrix.  Fix Generated Matrix creation to include update so that scalars are generated.


 M  +6 -0      src/libkstapp/matrixdialog.cpp  
 M  +4 -0      tests/main.cpp  
 M  +0 -1      tests/testdatamatrix.cpp  
 A             tests/testgeneratedmatrix.cpp   [License: GPL (v2+)]
 A             tests/testgeneratedmatrix.h   [License: GPL (v2+)]
 M  +2 -0      tests/tests.pro  


--- branches/work/kst/portto4/kst/src/libkstapp/matrixdialog.cpp #737575:737576
@@ -586,6 +586,11 @@
 #if 0
   GeneratedMatrixPtr matrix = new GeneratedMatrix(tag, nX, nY, minX, minY, stepX, stepY, gradZMin, gradZMax, xDirection);
 #endif
+
+  matrix->writeLock();
+  matrix->update(0);
+  matrix->unlock();
+
   return static_cast<ObjectPtr>(matrix);
 }
 
@@ -628,6 +633,7 @@
 
     generatedMatrix->writeLock();
     generatedMatrix->change(nX, nY, minX, minY, stepX, stepY, gradZMin, gradZMax, xDirection);
+    generatedMatrix->update(0);
     generatedMatrix->unlock();
   }
   return dataObject();
--- branches/work/kst/portto4/kst/tests/main.cpp #737575:737576
@@ -18,6 +18,7 @@
 #include "testscalar.h"
 #include "testmatrix.h"
 #include "testdatamatrix.h"
+#include "testgeneratedmatrix.h"
 #include "testcsd.h"
 #include "testpsd.h"
 #include "testhistogram.h"
@@ -56,6 +57,9 @@
   TestDataMatrix dataMatrixTest;
   QTest::qExec(&dataMatrixTest, argc, argv);
 
+  TestGeneratedMatrix generatedMatrixTest;
+  QTest::qExec(&generatedMatrixTest, argc, argv);
+
   TestLabelParser test9;
   QTest::qExec(&test9, argc, argv);
 
--- branches/work/kst/portto4/kst/tests/testdatamatrix.cpp #737575:737576
@@ -92,7 +92,6 @@
   QVERIFY(!ok);
   QCOMPARE(m1->value(10, 10, &ok), 0.0); //should be outside the boundaries.
   QVERIFY(!ok);
-  QCOMPARE(m1->sampleCount(), 0);
   QCOMPARE(m1->meanValue(), 0.0);
 
   m1->change(dsp, "[MATRIX,3,0,0,1,1]", 0, 0, -1, -1, false, false, 1);
--- branches/work/kst/portto4/kst/tests/tests.pro #737575:737576
@@ -27,6 +27,7 @@
     testdatamatrix.cpp \
     testdatasource.cpp \
     testeqparser.cpp \
+    testgeneratedmatrix.cpp \
     testhistogram.cpp \
     testlabelparser.cpp \
     testscalar.cpp \
@@ -42,6 +43,7 @@
     testdatasource.h \
     testhistogram.h \
     testeqparser.h \
+    testgeneratedmatrix.h \
     testlabelparser.h \
     testscalar.h \
     testmatrix.h \


More information about the Kst mailing list