! * check copy&paste (duplicate) of a XYFitCurve with the data source type "Histogram", * the pointer to the data source histogram must be properly restored after the duplication. */
| 291 | * the pointer to the data source histogram must be properly restored after the duplication. |
| 292 | */ |
| 293 | void AbstractAspectTest::pasteFitCurveSourceHistogram() { |
| 294 | Project project; |
| 295 | |
| 296 | auto* worksheet = new Worksheet(QStringLiteral("Worksheet")); |
| 297 | project.addChild(worksheet); |
| 298 | |
| 299 | auto* plot = new CartesianPlot(QStringLiteral("plot")); |
| 300 | worksheet->addChild(plot); |
| 301 | |
| 302 | auto* histogram = new Histogram(QStringLiteral("histogram")); |
| 303 | plot->addChild(histogram); |
| 304 | |
| 305 | auto* fitCurve = new XYFitCurve(QStringLiteral("fit")); |
| 306 | fitCurve->setDataSourceType(XYAnalysisCurve::DataSourceType::Histogram); |
| 307 | fitCurve->setDataSourceHistogram(histogram); |
| 308 | plot->addChild(fitCurve); |
| 309 | |
| 310 | fitCurve->copy(); |
| 311 | plot->paste(); |
| 312 | |
| 313 | // checks |
| 314 | const auto& fitCurves = project.children<XYFitCurve>(AbstractAspect::ChildIndexFlag::Recursive); |
| 315 | QCOMPARE(fitCurves.count(), 2); |
| 316 | auto* fitCurveCopy = fitCurves.at(1); |
| 317 | QCOMPARE(fitCurveCopy->dataSourceType(), XYAnalysisCurve::DataSourceType::Histogram); |
| 318 | QCOMPARE(fitCurveCopy->dataSourceHistogram(), histogram); |
| 319 | } |
| 320 | |
| 321 | void AbstractAspectTest::saveLoad() { |
| 322 | Project project; |
nothing calls this directly
no test coverage detected