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

Method addCurve

tests/analysis/fourier/FourierTest.cpp:65–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 } while (false);
64
65void 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
94void FourierTest::lowPassButterWorth() {
95 const QString filename = QStringLiteral("butterworth.csv");

Callers

nothing calls this directly

Calls 8

currentCurveMethod · 0.80
addFourierFilterCurveMethod · 0.80
addChildMethod · 0.45
setColumnCountMethod · 0.45
setNameMethod · 0.45
columnMethod · 0.45
setSelectedMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected