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

Method LtSpiceTranBinary

tests/import_export/Spice/SpiceFilterTest.cpp:464–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464void SpiceFilterTest::LtSpiceTranBinary() {
465 using namespace LowPassFilter_Transient;
466
467 READ_REFDATA(LTSpiceRefDataFile);
468 const QString& file = LTSpiceFile;
469 const int refColumnCount = refData.at(0).count();
470
471 bool binary;
472 QCOMPARE(SpiceFilter::isSpiceFile(file, &binary), true);
473 QCOMPARE(binary, true);
474
475 SpiceFilter filter;
476 auto res = filter.preview(file, numberPreviewData);
477
478 QCOMPARE(res.length(), numberPreviewData);
479 for (int i = 0; i < res.length(); i++) {
480 for (int j = 0; j < columnNames.length(); j++)
481 QVERIFY(qFuzzyCompare(res.at(i).at(j).toFloat(), refData.at(i).at(j).toFloat()));
482 }
483
484 QString resFileInfoString = filter.fileInfoString(file);
485 QCOMPARE(resFileInfoString, refFileInfoString);
486
487 Spreadsheet sheet(QStringLiteral("Test"), false);
488 filter.readDataFromFile(file, &sheet, AbstractFileFilter::ImportMode::Replace);
489
490 COMPARE_COLUMN_NAMES_MODE(sheet, columnNames, refColumnCount);
491
492 // Because the read data are floats, a float comparsion must be done, because
493 // comparing float and double will not work properly
494 COMPARE_ROW_VALUES_FLOAT(sheet, refData, refDataRowCount, refColumnCount);
495}
496
497void SpiceFilterTest::LtSpiceTranDoubleBinary() {
498 using namespace LowPassFilter_transient_doubleFlag;

Callers

nothing calls this directly

Calls 5

lengthMethod · 0.80
countMethod · 0.45
previewMethod · 0.45
fileInfoStringMethod · 0.45
readDataFromFileMethod · 0.45

Tested by

no test coverage detected