| 63 | } while (false); |
| 64 | |
| 65 | void FourierTest::addCurve() { |
| 66 | Project project; |
| 67 | |
| 68 | auto* ws = new Worksheet(QStringLiteral("Worksheet")); |
| 69 | project.addChild(ws); |
| 70 | |
| 71 | auto* plot = new CartesianPlot(QStringLiteral("plot")); |
| 72 | ws->addChild(plot); |
| 73 | |
| 74 | auto* sheet = new Spreadsheet(QStringLiteral("sheet")); |
| 75 | project.addChild(sheet); |
| 76 | sheet->setColumnCount(2); |
| 77 | sheet->column(0)->setName(QStringLiteral("x")); |
| 78 | sheet->column(1)->setName(QStringLiteral("y")); |
| 79 | |
| 80 | auto* curve = new XYCurve(QStringLiteral("curve")); |
| 81 | plot->addChild(curve); |
| 82 | |
| 83 | curve->d_func()->setSelected(true); |
| 84 | QCOMPARE(plot->currentCurve(), curve); |
| 85 | |
| 86 | plot->addFourierFilterCurve(); // Should not crash and curve should be assigned accordingly |
| 87 | |
| 88 | const auto& analysisCurves = plot->children<XYAnalysisCurve>(); |
| 89 | QCOMPARE(analysisCurves.count(), 1); |
| 90 | |
| 91 | QCOMPARE(analysisCurves.at(0)->d_func()->dataSourceCurve, curve); |
| 92 | } |
| 93 | |
| 94 | void FourierTest::lowPassButterWorth() { |
| 95 | const QString filename = QStringLiteral("butterworth.csv"); |
nothing calls this directly
no test coverage detected