Changeset View
Changeset View
Standalone View
Standalone View
tests/import_export/project/ProjectImportTest.cpp
Show All 20 Lines | |||||
21 | * You should have received a copy of the GNU General Public License * | 21 | * You should have received a copy of the GNU General Public License * | ||
22 | * along with this program; if not, write to the Free Software * | 22 | * along with this program; if not, write to the Free Software * | ||
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, * | 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||
24 | * Boston, MA 02110-1301 USA * | 24 | * Boston, MA 02110-1301 USA * | ||
25 | * * | 25 | * * | ||
26 | ***************************************************************************/ | 26 | ***************************************************************************/ | ||
27 | 27 | | |||
28 | #include "ProjectImportTest.h" | 28 | #include "ProjectImportTest.h" | ||
29 | #ifdef HAVE_LIBORIGIN | ||||
29 | #include "backend/datasources/projects/OriginProjectParser.h" | 30 | #include "backend/datasources/projects/OriginProjectParser.h" | ||
31 | #endif | ||||
30 | #include "backend/core/Project.h" | 32 | #include "backend/core/Project.h" | ||
31 | #include "backend/core/Workbook.h" | 33 | #include "backend/core/Workbook.h" | ||
32 | #include "backend/matrix/Matrix.h" | 34 | #include "backend/matrix/Matrix.h" | ||
33 | #include "backend/worksheet/Worksheet.h" | 35 | #include "backend/worksheet/Worksheet.h" | ||
34 | #include "backend/worksheet/plots/cartesian/CartesianPlot.h" | 36 | #include "backend/worksheet/plots/cartesian/CartesianPlot.h" | ||
35 | #include "backend/spreadsheet/Spreadsheet.h" | 37 | #include "backend/spreadsheet/Spreadsheet.h" | ||
36 | 38 | | |||
37 | void ProjectImportTest::initTestCase() { | 39 | void ProjectImportTest::initTestCase() { | ||
38 | const QString currentDir = __FILE__; | 40 | const QString currentDir = __FILE__; | ||
39 | m_dataDir = currentDir.left(currentDir.lastIndexOf(QDir::separator())) + QDir::separator() + QLatin1String("data") + QDir::separator(); | 41 | m_dataDir = currentDir.left(currentDir.lastIndexOf(QDir::separator())) + QDir::separator() + QLatin1String("data") + QDir::separator(); | ||
40 | 42 | | |||
41 | // needed in order to have the signals triggered by SignallingUndoCommand, see LabPlot.cpp | 43 | // needed in order to have the signals triggered by SignallingUndoCommand, see LabPlot.cpp | ||
42 | //TODO: redesign/remove this | 44 | //TODO: redesign/remove this | ||
43 | qRegisterMetaType<const AbstractAspect*>("const AbstractAspect*"); | 45 | qRegisterMetaType<const AbstractAspect*>("const AbstractAspect*"); | ||
44 | qRegisterMetaType<const AbstractColumn*>("const AbstractColumn*"); | 46 | qRegisterMetaType<const AbstractColumn*>("const AbstractColumn*"); | ||
45 | } | 47 | } | ||
46 | 48 | | |||
47 | //############################################################################## | 49 | //############################################################################## | ||
48 | //##################### import of LabPlot projects ############################ | 50 | //##################### import of LabPlot projects ############################ | ||
49 | //############################################################################## | 51 | //############################################################################## | ||
50 | 52 | | |||
51 | 53 | | |||
54 | #ifdef HAVE_LIBORIGIN | ||||
52 | //############################################################################## | 55 | //############################################################################## | ||
53 | //###################### import of Origin projects ############################ | 56 | //###################### import of Origin projects ############################ | ||
54 | //############################################################################## | 57 | //############################################################################## | ||
55 | //project tree of the file "origin8_test_tree_import.opj" | 58 | //project tree of the file "origin8_test_tree_import.opj" | ||
56 | /* | 59 | /* | ||
57 | test_tree_import\ | 60 | test_tree_import\ | ||
58 | \Book3 | 61 | \Book3 | ||
59 | \Folder | 62 | \Folder | ||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Line(s) | 299 | void ProjectImportTest::testOriginTextNumericColumns() { | |||
370 | column = spreadsheet->column(5); | 373 | column = spreadsheet->column(5); | ||
371 | QCOMPARE(column->columnMode(), AbstractColumn::Numeric); | 374 | QCOMPARE(column->columnMode(), AbstractColumn::Numeric); | ||
372 | QCOMPARE(column->valueAt(0), 1.1); | 375 | QCOMPARE(column->valueAt(0), 1.1); | ||
373 | QCOMPARE(column->valueAt(1), 2.2); | 376 | QCOMPARE(column->valueAt(1), 2.2); | ||
374 | QCOMPARE(column->valueAt(2), 3.3); | 377 | QCOMPARE(column->valueAt(2), 3.3); | ||
375 | QCOMPARE(!std::isnan(column->valueAt(3)), false); | 378 | QCOMPARE(!std::isnan(column->valueAt(3)), false); | ||
376 | QCOMPARE(!std::isnan(column->valueAt(4)), false); | 379 | QCOMPARE(!std::isnan(column->valueAt(4)), false); | ||
377 | } | 380 | } | ||
381 | #endif | ||||
378 | 382 | | |||
379 | QTEST_MAIN(ProjectImportTest) | 383 | QTEST_MAIN(ProjectImportTest) |