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

Method testDeclarationDefinitionOrder

kdevplatform/shell/tests/test_shellbuddy.cpp:134–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133
134void TestShellBuddy::testDeclarationDefinitionOrder()
135{
136 QCOMPARE(m_documentController->openDocuments().count(), 0);
137 enableBuddies();
138 enableOpenAfterCurrent();
139
140 QTemporaryDir dirA;
141 createFile(dirA, QStringLiteral("a.r.txt"));
142 createFile(dirA, QStringLiteral("b.r.txt"));
143 createFile(dirA, QStringLiteral("c.r.txt"));
144 createFile(dirA, QStringLiteral("a.l.txt"));
145 createFile(dirA, QStringLiteral("b.l.txt"));
146 createFile(dirA, QStringLiteral("c.l.txt"));
147
148 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "a.r.txt"));
149 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "b.l.txt"));
150 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "c.r.txt"));
151 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "b.r.txt"));
152 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "a.l.txt"));
153 m_documentController->openDocument(QUrl::fromLocalFile(dirA.path() + "c.l.txt"));
154
155 Sublime::Area *area = m_uiController->activeArea();
156 Sublime::AreaIndex* areaIndex = area->indexOf(m_uiController->activeSublimeWindow()->activeView());
157 QCOMPARE(m_documentController->openDocuments().count(), 6);
158 //QCOMPARE(m_uiController->documents().count(), 6);
159 QCOMPARE(areaIndex->viewCount(), 6);
160
161 qDebug() << qobject_cast<Sublime::UrlDocument*>(areaIndex->viewAt(0)->document())->url();
162 verifyFilename(areaIndex->views().value(0), "a.l.txt");
163 verifyFilename(areaIndex->views().value(1), "a.r.txt");
164 verifyFilename(areaIndex->views().value(2), "b.l.txt");
165 verifyFilename(areaIndex->views().value(3), "b.r.txt");
166 verifyFilename(areaIndex->views().value(4), "c.l.txt");
167 verifyFilename(areaIndex->views().value(5), "c.r.txt");
168
169 for(int i = 0; i < 6; i++)
170 m_documentController->openDocuments().at(0)->close(IDocument::Discard);
171 QCOMPARE(m_documentController->openDocuments().count(), 0);
172}
173
174void TestShellBuddy::testActivation()
175{

Callers

nothing calls this directly

Calls 15

openDocumentsMethod · 0.80
activeAreaMethod · 0.80
activeSublimeWindowMethod · 0.80
viewCountMethod · 0.80
viewAtMethod · 0.80
createFileFunction · 0.50
countMethod · 0.45
openDocumentMethod · 0.45
pathMethod · 0.45
indexOfMethod · 0.45
activeViewMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected