| 462 | } |
| 463 | |
| 464 | void 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 | |
| 497 | void SpiceFilterTest::LtSpiceTranDoubleBinary() { |
| 498 | using namespace LowPassFilter_transient_doubleFlag; |
nothing calls this directly
no test coverage detected