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

Method init

plugins/debuggercommon/tests/debuggertestbase.cpp:272–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void DebuggerTestBase::init()
273{
274 // remove all breakpoints - so we can set our own in the test
275 auto breakpointConfig = KSharedConfig::openConfig()->group("breakpoints");
276 breakpointConfig.writeEntry("number", 0);
277 breakpointConfig.sync();
278
279 auto* const breakpointModel = breakpoints();
280 breakpointModel->removeRows(0, breakpointModel->rowCount());
281
282 // Reset the VariableCollection to the default initial state so that test functions are independent from each other.
283
284 while (variableCollection()->watches()->childCount() != 0) {
285 auto* const watchVariable = watchVariableAt(0);
286 QVERIFY(watchVariable);
287 watchVariable->die();
288 }
289
290 const auto watchesIndex = variableCollection()->index(0, 0);
291 COMPARE_DATA(watchesIndex, Watches::sectionTitle());
292 // Creating a variable widget automatically expands the Watches item => auto-expand it in tests as well.
293 variableCollection()->expanded(watchesIndex);
294
295 const auto localsIndex = variableCollection()->index(1, 0);
296 COMPARE_DATA(localsIndex, VariableCollection::defaultLocalsSectionTitle());
297 // The Locals item is initially collapsed => ensure that it starts collapsed in tests as well.
298 variableCollection()->collapsed(localsIndex);
299
300 variableCollection()->variableWidgetHidden();
301}
302
303void DebuggerTestBase::testStdout()
304{

Callers

nothing calls this directly

Calls 10

variableCollectionFunction · 0.85
writeEntryMethod · 0.80
variableWidgetHiddenMethod · 0.80
removeRowsMethod · 0.45
rowCountMethod · 0.45
childCountMethod · 0.45
dieMethod · 0.45
indexMethod · 0.45
expandedMethod · 0.45
collapsedMethod · 0.45

Tested by

no test coverage detected