MCPcopy Create free account
hub / github.com/KDE/labplot / testImportIntPortion

Method testImportIntPortion

tests/import_export/HDF5/HDF5FilterTest.cpp:135–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void HDF5FilterTest::testImportIntPortion() {
136 Spreadsheet spreadsheet(QStringLiteral("test"), false);
137 HDF5Filter filter;
138
139 const QString& fileName = QFINDTESTDATA(QLatin1String("data/hdf5_test.h5"));
140 filter.setCurrentDataSetName(QLatin1String("/arrays/2D int array"));
141 // set start/end row/col
142 filter.setStartRow(2);
143 filter.setEndRow(3);
144 filter.setStartColumn(2);
145 filter.setEndColumn(3);
146 filter.readDataFromFile(fileName, &spreadsheet, AbstractFileFilter::ImportMode::Replace);
147
148 QCOMPARE(spreadsheet.columnCount(), 2);
149 QCOMPARE(spreadsheet.rowCount(), 2);
150 for (int i = 0; i < 2; i++) {
151 QCOMPARE(spreadsheet.column(i)->columnMode(), AbstractColumn::ColumnMode::Integer);
152 QCOMPARE(spreadsheet.column(i)->name(), QLatin1String("2D int array_") + QString::number(i + 1));
153 }
154
155 QCOMPARE(spreadsheet.column(0)->plotDesignation(), AbstractColumn::PlotDesignation::X);
156 QCOMPARE(spreadsheet.column(1)->plotDesignation(), AbstractColumn::PlotDesignation::Y);
157
158 QCOMPARE(spreadsheet.column(0)->valueAt(0), 1101);
159 QCOMPARE(spreadsheet.column(1)->valueAt(0), 1102);
160 QCOMPARE(spreadsheet.column(0)->valueAt(1), 1207);
161 QCOMPARE(spreadsheet.column(1)->valueAt(1), 1202);
162}
163
164void HDF5FilterTest::testImportVLEN() {
165 Spreadsheet spreadsheet(QStringLiteral("test"), false);

Callers

nothing calls this directly

Calls 13

setCurrentDataSetNameMethod · 0.80
setStartRowMethod · 0.45
setEndRowMethod · 0.45
setStartColumnMethod · 0.45
setEndColumnMethod · 0.45
readDataFromFileMethod · 0.45
columnCountMethod · 0.45
rowCountMethod · 0.45
columnModeMethod · 0.45
columnMethod · 0.45
nameMethod · 0.45
plotDesignationMethod · 0.45

Tested by

no test coverage detected