| 339 | } |
| 340 | |
| 341 | void TestAreaOperation::checkArea2(MainWindow *mw) |
| 342 | { |
| 343 | auto* const splitter = checkAreaCommon(mw); |
| 344 | RETURN_IF_TEST_FAILED(); |
| 345 | Area *area = mw->area(); |
| 346 | |
| 347 | //check that we have 4 properly initialized containers |
| 348 | const QList<Container*> containers = splitter->findChildren<Sublime::Container*>(); |
| 349 | QCOMPARE(containers.count(), 4); |
| 350 | |
| 351 | int widgetCount = 0; |
| 352 | for (Container* c : containers) { |
| 353 | for (int i = 0; i < c->count(); ++i) |
| 354 | QVERIFY(c->widget(i) != nullptr); |
| 355 | widgetCount += c->count(); |
| 356 | } |
| 357 | |
| 358 | ViewCounter c; |
| 359 | area->walkViews(c, area->rootIndex()); |
| 360 | QCOMPARE(widgetCount, c.count); |
| 361 | |
| 362 | //check that we have 7 splitters: 2 vertical and 1 horizontal, rest is not split |
| 363 | QList<QSplitter*> splitters = splitter->findChildren<QSplitter*>(); |
| 364 | splitters.append(qobject_cast<QSplitter*>(splitter)); |
| 365 | QCOMPARE(splitters.count(), 6+1); //6 child splitters + 1 central itself = 7 splitters |
| 366 | int verticalSplitterCount = 0; |
| 367 | int horizontalSplitterCount = 0; |
| 368 | for (QSplitter* s : std::as_const(splitters)) { |
| 369 | if (s->count() == 1) |
| 370 | continue; //this is a splitter with container inside, its orientation is not relevant |
| 371 | if (s->orientation() == Qt::Vertical) |
| 372 | verticalSplitterCount += 1; |
| 373 | else |
| 374 | horizontalSplitterCount += 1; |
| 375 | } |
| 376 | QCOMPARE(verticalSplitterCount, 2); |
| 377 | QCOMPARE(horizontalSplitterCount, 1); |
| 378 | } |
| 379 | |
| 380 | void TestAreaOperation::areaCloning() |
| 381 | { |
nothing calls this directly
no test coverage detected