[Kst] branches/work/kst/portto4/kst
Adam Treat
treat at kde.org
Wed Sep 26 05:52:43 CEST 2007
SVN commit 717109 by treat:
* Port tests over
D old_tests/testmatrix.cpp
D old_tests/testscalars.cpp
D old_tests/testscalars.h
D old_tests/testvector.cpp
M +14 -1 tests/main.cpp
M +28 -7 tests/testdatasources.cpp
M +1 -21 tests/testdatasources.h
A tests/testmatrix.cpp old_tests/testmatrix.cpp#717063 [License: GPL (v2+)]
M +8 -2 tests/tests.pro
A tests/testscalars.cpp old_tests/testscalars.cpp#717063 [License: GPL (v2+)]
A tests/testscalars.h old_tests/testscalars.h#717063 [License: GPL (v2+)]
A tests/testvector.cpp old_tests/testvector.cpp#717063 [License: GPL (v2+)]
--- branches/work/kst/portto4/kst/tests/main.cpp #717108:717109
@@ -11,15 +11,28 @@
#include <QCoreApplication>
+#include <QtTest>
+
#include "testdatasources.h"
+#include "testvector.h"
+#include "testscalars.h"
+#include "testmatrix.h"
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
TestDataSources test1;
-
QTest::qExec(&test1, argc, argv);
+ TestVector test2;
+ QTest::qExec(&test2, argc, argv);
+
+ TestScalar test3;
+ QTest::qExec(&test3, argc, argv);
+
+ TestMatrix test4;
+ QTest::qExec(&test4, argc, argv);
+
return 0;
}
--- branches/work/kst/portto4/kst/tests/testdatasources.cpp #717108:717109
@@ -11,6 +11,24 @@
#include "testdatasources.h"
+// HACK to get at methods we shouldn't be getting at
+#define protected public
+#include <kstdatasource.h>
+#undef protected
+
+#include <QtTest>
+
+#include <QDir>
+#include <QFile>
+#include <QSettings>
+#include <QTemporaryFile>
+
+#include <kstrvector.h>
+#include <kstdatacollection.h>
+#include <kstdataobjectcollection.h>
+
+#include <math.h>
+
#ifndef INF
double INF = 1.0/0.0;
#endif
@@ -32,7 +50,7 @@
void TestDataSources::testAscii() {
if (!_plugins.contains("ASCII File Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
{
QTemporaryFile tf;
@@ -126,7 +144,10 @@
QCOMPARE(rvp->length(), 4);
QCOMPARE(rvp->value()[0], 0.2);
QVERIFY(rvp->value()[1] != rvp->value()[1]);
+
+ QEXPECT_FAIL("", "Bug in Qt qFuzzyCompare can not compare inf...", Continue);
QCOMPARE(rvp->value()[2], INF);
+
QCOMPARE(rvp->value()[3], 0.0);
rvp = new KstRVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
rvp->writeLock();
@@ -260,7 +281,7 @@
void TestDataSources::testDirfile() {
if (!_plugins.contains("DirFile Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
QWARN("These tests assume that the dirfile was generated with dirfile_maker");
@@ -408,31 +429,31 @@
void TestDataSources::testCDF() {
if (!_plugins.contains("CDF File Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
}
void TestDataSources::testFrame() {
if (!_plugins.contains("Frame Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
}
void TestDataSources::testIndirect() {
if (!_plugins.contains("Indirect File Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
}
void TestDataSources::testLFI() {
if (!_plugins.contains("LFIIO Reader"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
}
void TestDataSources::testPlanck() {
if (!_plugins.contains("PLANCK Plugin"))
- QFAIL("...couldn't find plugin.");
+ QSKIP("...couldn't find plugin.", SkipAll);
}
--- branches/work/kst/portto4/kst/tests/testdatasources.h #717108:717109
@@ -12,32 +12,12 @@
#ifndef TESTDATASOURCES_H
#define TESTDATASOURCES_H
-// HACK to get at methods we shouldn't be getting at
-#define protected public
-#include <kstdatasource.h>
-#undef protected
-
-#include <QtTest>
-
-#include <QDir>
#include <QObject>
-#include <QFile>
-#include <QSettings>
-#include <QTemporaryFile>
+#include <QStringList>
-#include <kstrvector.h>
-#include <kstdatacollection.h>
-#include <kstdataobjectcollection.h>
-
-#include <math.h>
-
class TestDataSources : public QObject
{
Q_OBJECT
- public:
- TestDataSources() : QObject() {}
- virtual ~TestDataSources() {}
-
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
--- branches/work/kst/portto4/kst/tests/tests.pro #717108:717109
@@ -21,9 +21,15 @@
SOURCES += \
main.cpp \
- testdatasources.cpp
+ testdatasources.cpp \
+ testvector.cpp \
+ testscalars.cpp \
+ testmatrix.cpp
HEADERS += \
- testdatasources.h
+ testdatasources.h \
+ testvector.h \
+ testscalars.h \
+ testmatrix.h
QMAKE_RPATHDIR += $$OUTPUT_DIR/lib $$OUTPUT_DIR/plugin
More information about the Kst
mailing list