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

Method testDeclarationDefinitionOrder

plugins/clang/tests/test_buddies.cpp:124–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void TestBuddies::testDeclarationDefinitionOrder()
125{
126 enableBuddies();
127 enableOpenAfterCurrent();
128
129 QTemporaryDir tempDirA;
130 QDir dirA(tempDirA.path());
131 createFile(dirA, QStringLiteral("a.cpp"));
132 createFile(dirA, QStringLiteral("b.cpp"));
133 createFile(dirA, QStringLiteral("c.cpp"));
134 createFile(dirA, QStringLiteral("a.h"));
135 createFile(dirA, QStringLiteral("b.h"));
136 createFile(dirA, QStringLiteral("c.h"));
137
138 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("a.cpp"))));
139 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("b.h"))));
140 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("c.cpp"))));
141 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("b.cpp"))));
142 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("a.h"))));
143 m_documentController->openDocument(QUrl::fromLocalFile(dirA.filePath(QStringLiteral("c.h"))));
144
145 Sublime::Area *area = m_uiController->activeArea();
146 Sublime::AreaIndex* areaIndex = area->indexOf(toSublimeWindow(m_uiController->activeMainWindow())->activeView());
147 QCOMPARE(m_documentController->openDocuments().count(), 6);
148 //QCOMPARE(m_uiController->documents().count(), 6);
149 QCOMPARE(areaIndex->viewCount(), 6);
150
151 verifyFilename(areaIndex->views().value(0), QStringLiteral("a.h"));
152 verifyFilename(areaIndex->views().value(1), QStringLiteral("a.cpp"));
153 verifyFilename(areaIndex->views().value(2), QStringLiteral("b.h"));
154 verifyFilename(areaIndex->views().value(3), QStringLiteral("b.cpp"));
155 verifyFilename(areaIndex->views().value(4), QStringLiteral("c.h"));
156 verifyFilename(areaIndex->views().value(5), QStringLiteral("c.cpp"));
157}
158
159void TestBuddies::testMultiDotFilenames()
160{

Callers

nothing calls this directly

Calls 14

toSublimeWindowFunction · 0.85
activeAreaMethod · 0.80
openDocumentsMethod · 0.80
viewCountMethod · 0.80
createFileFunction · 0.70
pathMethod · 0.45
openDocumentMethod · 0.45
filePathMethod · 0.45
indexOfMethod · 0.45
activeViewMethod · 0.45
activeMainWindowMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected