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

Method testQString

plugins/lldb/unittests/test_lldbformatters.cpp:271–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void LldbFormattersTest::testQString()
272{
273 TestLaunchConfiguration cfg(QStringLiteral("debuggee_qstring"));
274 addCodeBreakpoint(QUrl::fromLocalFile(findSourceFile("qstring.cpp")), 4);
275
276 QVERIFY(m_session->startDebugging(&cfg, m_iface));
277 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
278
279 // Should be two rows ('auto', 'local')
280 QCOMPARE(variableCollection()->rowCount(), 2);
281
282 variableCollection()->expanded(localVariableIndexAt(0));
283 WAIT_FOR_A_WHILE_AND_IDLE(m_session, 50);
284
285 QString expected = QStringLiteral("test最后一个不是特殊字符'\"\\u6211");
286 QStringList children;
287 for (auto ch : std::as_const(expected)) {
288 children << Utils::quote(ch, '\'');
289 }
290
291 VERIFY_LOCAL(0, "s", Utils::quote(expected), children);
292
293 m_session->stepOver();
294 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
295 QCOMPARE(m_session->currentLine(), 5);
296
297 expected.append("x");
298 children << QStringLiteral("'x'");
299
300 VERIFY_LOCAL(0, "s", Utils::quote(expected), children);
301
302 m_session->run();
303 WAIT_FOR_STATE(m_session, DebugSession::EndedState);
304}
305
306void LldbFormattersTest::testQByteArray()
307{

Callers

nothing calls this directly

Calls 10

findSourceFileFunction · 0.85
variableCollectionFunction · 0.85
quoteFunction · 0.85
startDebuggingMethod · 0.80
currentLineMethod · 0.80
rowCountMethod · 0.45
expandedMethod · 0.45
stepOverMethod · 0.45
appendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected