| 104 | } |
| 105 | |
| 106 | void TestClangUtils::testGetScope() |
| 107 | { |
| 108 | QFETCH(QByteArray, code); |
| 109 | QFETCH(int, cursorIndex); |
| 110 | QFETCH(QString, expectedScope); |
| 111 | |
| 112 | CursorCollectorVisitor visitor; |
| 113 | auto unit = runVisitor(code, visitor); |
| 114 | QVERIFY(cursorIndex < visitor.cursors.size()); |
| 115 | const auto cursor = visitor.cursors[cursorIndex]; |
| 116 | clangDebug() << "Found decl:" << clang_getCursorSpelling(cursor) << "| range:" << ClangRange(clang_getCursorExtent(cursor)).toRange(); |
| 117 | const QString scope = ClangUtils::getScope(cursor); |
| 118 | QCOMPARE(scope, expectedScope); |
| 119 | |
| 120 | QVERIFY(!visitor.cursors.isEmpty()); |
| 121 | } |
| 122 | |
| 123 | void TestClangUtils::testGetScope_data() |
| 124 | { |
nothing calls this directly
no test coverage detected