| 476 | } |
| 477 | |
| 478 | void TestProjectModel::testItemsForPath_data() |
| 479 | { |
| 480 | QTest::addColumn<Path>("path"); |
| 481 | QTest::addColumn<ProjectBaseItem*>("root"); |
| 482 | QTest::addColumn<int>("matches"); |
| 483 | |
| 484 | { |
| 485 | auto* root = new ProjectFolderItem(nullptr, Path(QUrl::fromLocalFile(QDir::tempPath()))); |
| 486 | auto* file = new ProjectFileItem(QStringLiteral("a"), root); |
| 487 | QTest::newRow("find one") << file->path() << static_cast<ProjectBaseItem*>(root) << 1; |
| 488 | } |
| 489 | |
| 490 | { |
| 491 | auto* root = new ProjectFolderItem(nullptr, Path(QUrl::fromLocalFile(QDir::tempPath()))); |
| 492 | auto* folder = new ProjectFolderItem(QStringLiteral("a"), root); |
| 493 | auto* file = new ProjectFileItem(QStringLiteral("foo"), folder); |
| 494 | auto* target = new ProjectTargetItem(nullptr, QStringLiteral("b"), root); |
| 495 | auto* file2 = new ProjectFileItem(nullptr, file->path(), target); |
| 496 | Q_UNUSED(file2); |
| 497 | QTest::newRow("find two") << file->path() << static_cast<ProjectBaseItem*>(root) << 2; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | void TestProjectModel::testProjectProxyModel() |
| 502 | { |