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

Method loadLegacyProject

tests/multirange/MultiRangeTest3.cpp:106–123  ·  view source on GitHub ↗

! * test the load of a project created with v.2.6 that didn't have any ranges nor multiple coordinates systems yet. * upon loading the default coordinate system together with the ranges have to be created. */

Source from the content-addressed store, hash-verified

104 * upon loading the default coordinate system together with the ranges have to be created.
105 */
106void MultiRangeTest3::loadLegacyProject() {
107 Project project;
108 project.load(QFINDTESTDATA(QLatin1String("data/histogram_2.6.lml")));
109
110 // check the content
111 const auto& plots = project.children<CartesianPlot>(AbstractAspect::ChildIndexFlag::Recursive);
112 QCOMPARE(plots.size(), 1);
113 const auto* plot = plots.first();
114
115 const auto& histograms = plot->children<Histogram>();
116 QCOMPARE(histograms.size(), 1);
117 const auto* histogram = histograms.first();
118
119 // check the ranges
120 QCOMPARE(plot->coordinateSystemCount(), 1);
121 CHECK_RANGE(plot, histogram, Dimension::X, 0., 6.);
122 CHECK_RANGE(plot, histogram, Dimension::Y, 0., 7.);
123}
124
125QTEST_MAIN(MultiRangeTest3)

Callers

nothing calls this directly

Calls 3

loadMethod · 0.45
sizeMethod · 0.45
coordinateSystemCountMethod · 0.45

Tested by

no test coverage detected