| 42 | using Dimension = CartesianCoordinateSystem::Dimension; |
| 43 | |
| 44 | void RetransformTest::TestLoadProject() { |
| 45 | RetransformCallCounter c; |
| 46 | Project project; |
| 47 | |
| 48 | // Does not work during load. |
| 49 | // connect(&project, &Project::aspectAdded, &c, &RetransformCallCounter::aspectAdded); |
| 50 | |
| 51 | project.load(QFINDTESTDATA(QLatin1String("data/p1.lml"))); |
| 52 | |
| 53 | QHash<QString, int> h = {{QStringLiteral("Project/Worksheet/xy-plot"), 1}, |
| 54 | {QStringLiteral("Project/Worksheet/xy-plot/x"), 1}, |
| 55 | {QStringLiteral("Project/Worksheet/xy-plot/y"), 1}, |
| 56 | {QStringLiteral("Project/Worksheet/xy-plot/sin"), 1}, |
| 57 | {QStringLiteral("Project/Worksheet/xy-plot/cos"), 1}, |
| 58 | {QStringLiteral("Project/Worksheet/xy-plot/tan"), 1}, |
| 59 | {QStringLiteral("Project/Worksheet/xy-plot/y-axis"), 1}, |
| 60 | {QStringLiteral("Project/Worksheet/xy-plot/legend"), 1}, |
| 61 | {QStringLiteral("Project/Worksheet/xy-plot/plotImage"), 1}, |
| 62 | {QStringLiteral("Project/Worksheet/xy-plot/plotText"), 1}, |
| 63 | {QStringLiteral("Project/Worksheet/Text Label"), 1}, |
| 64 | {QStringLiteral("Project/Worksheet/Image"), 1}, |
| 65 | {QStringLiteral("Project/Worksheet/plot2"), 1}, |
| 66 | {QStringLiteral("Project/Worksheet/plot2/x"), 1}, |
| 67 | {QStringLiteral("Project/Worksheet/plot2/y"), 1}, |
| 68 | {QStringLiteral("Project/Worksheet/plot2/xy-curve"), 1}}; |
| 69 | |
| 70 | auto children = project.children(AspectType::AbstractAspect, AbstractAspect::ChildIndexFlag::Recursive); |
| 71 | for (auto& child : children) { |
| 72 | int expectedCallCount = 0; |
| 73 | const QString& path = child->path(); |
| 74 | if (h.contains(path)) |
| 75 | expectedCallCount = h.value(path); |
| 76 | COMPARE(c.callCount(child), expectedCallCount, path); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // Problem in this project was that the second axis labels are not loaded. Zooming in/out once shows the correct range |
| 81 | void RetransformTest::TestLoadProject2() { |