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

Method testGetScope_data

plugins/clang/tests/test_clangutils.cpp:123–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void TestClangUtils::testGetScope_data()
124{
125 QTest::addColumn<QByteArray>("code");
126 QTest::addColumn<int>("cursorIndex");
127 QTest::addColumn<QString>("expectedScope");
128
129 QTest::newRow("func-decl-inside-ns")
130 << QByteArray("namespace ns1 { void foo(); } ns1::foo() {}")
131 << 2
132 << "ns1";
133 QTest::newRow("fwd-decl-inside-ns")
134 << QByteArray("namespace ns1 { struct foo; } struct ns1::foo {};")
135 << 2
136 << "ns1";
137 QTest::newRow("fwd-decl-inside-ns-inside-ns")
138 << QByteArray("namespace ns1 { namespace ns2 { struct foo; } } struct ns1::ns2::foo {};")
139 << 3
140 << "ns1::ns2";
141 QTest::newRow("fwd-decl-inside-ns-inside-ns")
142 << QByteArray("namespace ns1 { namespace ns2 { struct foo; } } struct ns1::ns2::foo {};")
143 << 3
144 << "ns1::ns2";
145 QTest::newRow("using-namespace")
146 << QByteArray("namespace ns1 { struct klass { struct foo; }; } using namespace ns1; struct klass::foo {};")
147 << 5
148 << "ns1::klass";
149 QTest::newRow("fwd-decl-def-inside-namespace")
150 << QByteArray("namespace ns1 { struct klass { struct foo; }; } namespace ns1 { struct klass::foo {}; }")
151 << 4
152 << "klass";
153}
154
155void TestClangUtils::testTemplateArgumentTypes()
156{

Callers

nothing calls this directly

Calls 1

QByteArrayClass · 0.50

Tested by

no test coverage detected