MCPcopy Create free account
hub / github.com/KDE/kdevelop / testGetScope

Method testGetScope

plugins/clang/tests/test_clangutils.cpp:106–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void 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
123void TestClangUtils::testGetScope_data()
124{

Callers

nothing calls this directly

Calls 4

runVisitorFunction · 0.85
toRangeMethod · 0.80
sizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected