[Kst] branches/work/kst/portto4/kst/tests
Mike Fenton
mike at staikos.net
Fri Oct 31 17:16:25 CET 2008
SVN commit 878229 by fenton:
Disable DataSource test from DataMatrix now that there is no Ascii Matrix.
M +71 -69 testdatamatrix.cpp
--- branches/work/kst/portto4/kst/tests/testdatamatrix.cpp #878228:878229
@@ -31,13 +31,13 @@
void TestDataMatrix::testDataMatrix() {
bool ok = true;
- QSettings *settingsObject = new QSettings("kstdatarc", QSettings::IniFormat);
- Kst::DataSource::setupOnStartup(settingsObject);
- QStringList _plugins = Kst::DataSource::pluginList();
+// QSettings *settingsObject = new QSettings("kstdatarc", QSettings::IniFormat);
+// Kst::DataSource::setupOnStartup(settingsObject);
+// QStringList _plugins = Kst::DataSource::pluginList();
+//
+// if (!_plugins.contains("ASCII File Reader"))
+// QSKIP("...couldn't find plugin.", SkipAll);
- if (!_plugins.contains("ASCII File Reader"))
- QSKIP("...couldn't find plugin.", SkipAll);
-
// for ascii data sources, matrix fields start with [MATRIXNAME,Y,x,y,w,l]
// where Y = size of y dimension
// x = x coordinate of minimum
@@ -45,42 +45,42 @@
// w = x step size
// l = y step size
- QTemporaryFile tf;
- tf.open();
- QTextStream ts(&tf);
- ts << "[MATRIX,3,0,0,1,1]" << endl;
- ts << "1.0" << endl;
- ts << "2.0" << endl;
- ts << "3.0" << endl;
- ts << "4.0" << endl;
- ts << "5.0" << endl;
- ts << "6.0" << endl;
- ts << "7.0" << endl;
- ts << "8.0" << endl;
- ts << "9.0" << endl;
- ts.flush();
+// QTemporaryFile tf;
+// tf.open();
+// QTextStream ts(&tf);
+// ts << "[MATRIX,3,0,0,1,1]" << endl;
+// ts << "1.0" << endl;
+// ts << "2.0" << endl;
+// ts << "3.0" << endl;
+// ts << "4.0" << endl;
+// ts << "5.0" << endl;
+// ts << "6.0" << endl;
+// ts << "7.0" << endl;
+// ts << "8.0" << endl;
+// ts << "9.0" << endl;
+// ts.flush();
+//
+//
+// Kst::DataSourcePtr dsp = Kst::DataSource::loadSource(&_store, tf.fileName());
+//
+// QVERIFY(dsp);
+// QVERIFY(dsp->isValid());
+//
+// QXmlStreamAttributes attributes;
+// attributes.append("intepretation", "0");
+// attributes.append("delimiters", "#/c!;");
+// attributes.append("columntype", "0");
+// attributes.append("columndelimiters", "");
+// attributes.append("headerstart", "1");
+// attributes.append("fields", "0");
+// attributes.append("readfields", "true");
+//
+// dsp->parseProperties(attributes);
+//
+// dsp->writeLock();
+// dsp->reset();
+// dsp->unlock();
-
- Kst::DataSourcePtr dsp = Kst::DataSource::loadSource(&_store, tf.fileName());
-
- QVERIFY(dsp);
- QVERIFY(dsp->isValid());
-
- QXmlStreamAttributes attributes;
- attributes.append("intepretation", "0");
- attributes.append("delimiters", "#/c!;");
- attributes.append("columntype", "0");
- attributes.append("columndelimiters", "");
- attributes.append("headerstart", "1");
- attributes.append("fields", "0");
- attributes.append("readfields", "true");
-
- dsp->parseProperties(attributes);
-
- dsp->writeLock();
- dsp->reset();
- dsp->unlock();
-
//basic default constructor values
Kst::DataMatrixPtr m1 = Kst::kst_cast<Kst::DataMatrix>(_store.createObject<Kst::DataMatrix>());
QCOMPARE(m1->sampleCount(), 0);
@@ -92,35 +92,37 @@
QVERIFY(!ok);
QCOMPARE(m1->meanValue(), 0.0);
- m1->change(dsp, "[MATRIX,3,0,0,1,1]", 0, 0, -1, -1, false, false, 1, 0, 0, 1, 1);
+// m1->change(dsp, "[MATRIX,3,0,0,1,1]", 0, 0, -1, -1, false, false, 1, 0, 0, 1, 1);
+//
+// m1->writeLock();
+// m1->update();
+// m1->unlock();
- m1->writeLock();
- m1->update();
- m1->unlock();
-
- QCOMPARE(m1->sampleCount(), 9);
- QCOMPARE(m1->minValue(), 1.0);
- QCOMPARE(m1->maxValue(), 9.0);
- QCOMPARE(m1->value(0, 0, &ok), 1.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(0, 1, &ok), 2.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(0, 2, &ok), 3.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(1, 0, &ok), 4.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(1, 1, &ok), 5.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(1, 2, &ok), 6.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(2, 0, &ok), 7.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(2, 1, &ok), 8.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(2, 2, &ok), 9.0);
- QVERIFY(ok);
- QCOMPARE(m1->value(10, 10, &ok), 0.0); //should be outside the boundaries.
- QVERIFY(!ok);
+ QSKIP("No Data Test currently exists for DataMatrices.", SkipAll);
+// qDebug() << "No Data Test currently exists for DataMatrices.";
+// QCOMPARE(m1->sampleCount(), 9);
+// QCOMPARE(m1->minValue(), 1.0);
+// QCOMPARE(m1->maxValue(), 9.0);
+// QCOMPARE(m1->value(0, 0, &ok), 1.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(0, 1, &ok), 2.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(0, 2, &ok), 3.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(1, 0, &ok), 4.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(1, 1, &ok), 5.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(1, 2, &ok), 6.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(2, 0, &ok), 7.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(2, 1, &ok), 8.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(2, 2, &ok), 9.0);
+// QVERIFY(ok);
+// QCOMPARE(m1->value(10, 10, &ok), 0.0); //should be outside the boundaries.
+// QVERIFY(!ok);
}
// vim: ts=2 sw=2 et
More information about the Kst
mailing list