| 98 | } |
| 99 | |
| 100 | void TestAreaWalker::toolViewWalkerModes() |
| 101 | { |
| 102 | auto *controller = new Controller(this); |
| 103 | Document *doc = new UrlDocument(controller, QUrl::fromLocalFile(QStringLiteral("~/foo.cpp"))); |
| 104 | Area *area = new Area(controller, QStringLiteral("Area")); |
| 105 | View *view = doc->createView(); |
| 106 | view->setObjectName(QStringLiteral("1")); |
| 107 | area->addToolView(view, Sublime::Left); |
| 108 | view = doc->createView(); |
| 109 | view->setObjectName(QStringLiteral("2")); |
| 110 | area->addToolView(view, Sublime::Left); |
| 111 | view = doc->createView(); |
| 112 | view->setObjectName(QStringLiteral("3")); |
| 113 | area->addToolView(view, Sublime::Bottom); |
| 114 | |
| 115 | AreaStopper stopper1(QStringLiteral("1")); |
| 116 | area->walkToolViews(stopper1, Sublime::AllPositions); |
| 117 | QCOMPARE(stopper1.list.join(QLatin1Char(' ')), QStringLiteral("1")); |
| 118 | |
| 119 | AreaStopper stopper2(QStringLiteral("2")); |
| 120 | area->walkToolViews(stopper2, Sublime::AllPositions); |
| 121 | QCOMPARE(stopper2.list.join(QLatin1Char(' ')), QStringLiteral("1 2")); |
| 122 | |
| 123 | AreaStopper stopper3(QStringLiteral("3")); |
| 124 | area->walkToolViews(stopper3, Sublime::AllPositions); |
| 125 | QCOMPARE(stopper3.list.join(QLatin1Char(' ')), QStringLiteral("1 2 3")); |
| 126 | |
| 127 | AreaStopper noStopper(QStringLiteral("X")); |
| 128 | area->walkToolViews(noStopper, Sublime::AllPositions); |
| 129 | QCOMPARE(noStopper.list.join(QLatin1Char(' ')), QStringLiteral("1 2 3")); |
| 130 | |
| 131 | delete area; |
| 132 | delete doc; |
| 133 | delete controller; |
| 134 | } |
| 135 | |
| 136 | QTEST_MAIN(TestAreaWalker) |
| 137 |
nothing calls this directly
no test coverage detected