| 269 | } |
| 270 | |
| 271 | void 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 | |
| 306 | void LldbFormattersTest::testQByteArray() |
| 307 | { |
nothing calls this directly
no test coverage detected