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

Method benchDoubleImport

tests/import_export/Binary/BinaryFilterTest.cpp:378–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void BinaryFilterTest::benchDoubleImport() {
379 QFETCH(size_t, lineCount);
380
381 Spreadsheet spreadsheet(QStringLiteral("test"), false);
382 BinaryFilter filter;
383 filter.setDataType(BinaryFilter::DataType::REAL64);
384 filter.setByteOrder(QDataStream::ByteOrder::BigEndian);
385 filter.setVectors(paths);
386
387 const int p = paths; // need local variable
388 QBENCHMARK {
389 filter.readDataFromFile(benchDataFileName, &spreadsheet, AbstractFileFilter::ImportMode::Replace);
390
391 QCOMPARE(spreadsheet.columnCount(), p);
392 QCOMPARE(spreadsheet.rowCount(), lineCount);
393
394 QCOMPARE(spreadsheet.column(0)->valueAt(0), 0.120997813055);
395 QCOMPARE(spreadsheet.column(1)->valueAt(0), 0.119301077563219);
396 QCOMPARE(spreadsheet.column(2)->valueAt(0), -0.0209979608555485);
397 }
398}
399
400void BinaryFilterTest::benchDoubleImport_cleanup() {

Callers

nothing calls this directly

Calls 8

setByteOrderMethod · 0.80
setVectorsMethod · 0.80
setDataTypeMethod · 0.45
readDataFromFileMethod · 0.45
columnCountMethod · 0.45
rowCountMethod · 0.45
valueAtMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected