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

Method cloneSession

kdevplatform/shell/tests/test_sessioncontroller.cpp:152–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void TestSessionController::cloneSession()
153{
154 QString sessionName = QStringLiteral("CloneableSession");
155 QString testgrp = QStringLiteral("TestGroup");
156 QString testentry = QStringLiteral("TestEntry");
157 QString testval = QStringLiteral("TestValue");
158 int sessionCount = m_sessionCtrl->sessionNames().count();
159 m_sessionCtrl->createSession( sessionName );
160 Session* s = m_sessionCtrl->session( sessionName );
161 s->config()->group( testgrp ).writeEntry( testentry, testval );
162 s->config()->sync();
163 QCOMPARE( sessionCount+1, m_sessionCtrl->sessionNames().count() );
164 QVERIFY( m_sessionCtrl->session( sessionName ) );
165
166 QString newSession = m_sessionCtrl->cloneSession( sessionName );
167 QVERIFY( m_sessionCtrl->session( newSession ) );
168 QCOMPARE( sessionCount+2, m_sessionCtrl->sessionNames().count() );
169 Session* news = m_sessionCtrl->session( newSession );
170 QCOMPARE( testval, news->config()->group( testgrp ).readEntry( testentry, "" ) );
171 QCOMPARE( i18n( "Copy of %1", sessionName ), news->name() );
172
173 verifySessionDir( news );
174
175
176}
177
178void TestSessionController::readFromConfig()
179{

Callers

nothing calls this directly

Calls 9

verifySessionDirFunction · 0.85
sessionNamesMethod · 0.80
writeEntryMethod · 0.80
readEntryMethod · 0.80
countMethod · 0.45
createSessionMethod · 0.45
sessionMethod · 0.45
configMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected