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

Method deleteSession

kdevplatform/shell/tests/test_sessioncontroller.cpp:124–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void TestSessionController::deleteSession()
125{
126 const QString sessionName = QStringLiteral("TestSession3");
127 int sessionCount = m_sessionCtrl->sessionNames().count();
128 QPointer<Session> s = m_sessionCtrl->createSession( sessionName );
129 QString sessionId = s->id().toString();
130 QCOMPARE( sessionCount+1, m_sessionCtrl->sessionNames().count() );
131 verifySessionDir( s.data() );
132 const auto sessionDir = s->dataDirectory();
133
134 QSignalSpy spy(m_sessionCtrl, SIGNAL(sessionDeleted(QString)));
135 {
136 TryLockSessionResult lock = m_sessionCtrl->tryLockSession(sessionId);
137 QVERIFY(lock.lock);
138 m_sessionCtrl->deleteSession( lock.lock );
139 }
140 QCOMPARE( sessionCount, m_sessionCtrl->sessionNames().count() );
141 QVERIFY( !m_sessionCtrl->sessionNames().contains(sessionId) );
142
143 QCOMPARE(spy.size(), 1);
144 QList<QVariant> arguments = spy.takeFirst();
145
146 QString emittedSession = arguments.at(0).toString();
147 QCOMPARE( sessionId, emittedSession );
148
149 verifySessionDir( sessionDir, sessionName, false );
150}
151
152void TestSessionController::cloneSession()
153{

Callers 1

cleanupTestCaseMethod · 0.45

Calls 12

verifySessionDirFunction · 0.85
sessionNamesMethod · 0.80
dataDirectoryMethod · 0.80
countMethod · 0.45
createSessionMethod · 0.45
toStringMethod · 0.45
idMethod · 0.45
dataMethod · 0.45
tryLockSessionMethod · 0.45
containsMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected