| 1687 | } |
| 1688 | |
| 1689 | void DebuggerTestBase::testVariablesLocalsStruct() |
| 1690 | { |
| 1691 | auto* const session = createTestDebugSession(); |
| 1692 | TestLaunchConfiguration cfg; |
| 1693 | session->variableController()->setAutoUpdate(IVariableController::UpdateLocals); |
| 1694 | |
| 1695 | addDebugeeBreakpoint(39); |
| 1696 | ActiveStateSessionSpy sessionSpy(session); |
| 1697 | START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy); |
| 1698 | |
| 1699 | const auto i = variableCollection()->index(1, 0); |
| 1700 | QCOMPARE(variableCollection()->rowCount(i), 4); |
| 1701 | |
| 1702 | auto structIndex = 0; |
| 1703 | for (auto j = 0; j < 3; ++j) { |
| 1704 | if (variableCollection()->index(j, 0, i).data().toString() == QLatin1String("ts")) { |
| 1705 | structIndex = j; |
| 1706 | } |
| 1707 | } |
| 1708 | |
| 1709 | COMPARE_DATA(variableCollection()->index(structIndex, 0, i), "ts"); |
| 1710 | COMPARE_DATA(variableCollection()->index(structIndex, 1, i), "{...}"); |
| 1711 | const auto ts = variableCollection()->index(structIndex, 0, i); |
| 1712 | COMPARE_DATA(variableCollection()->index(0, 0, ts), "..."); |
| 1713 | |
| 1714 | EXPAND_VARIABLE_COLLECTION(ts); |
| 1715 | COMPARE_DATA(variableCollection()->index(0, 0, ts), "a"); |
| 1716 | COMPARE_DATA(variableCollection()->index(0, 1, ts), "0"); |
| 1717 | COMPARE_DATA(variableCollection()->index(1, 0, ts), "b"); |
| 1718 | COMPARE_DATA(variableCollection()->index(1, 1, ts), "1"); |
| 1719 | COMPARE_DATA(variableCollection()->index(2, 0, ts), "c"); |
| 1720 | COMPARE_DATA(variableCollection()->index(2, 1, ts), "2"); |
| 1721 | |
| 1722 | STEP_INTO_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy); |
| 1723 | COMPARE_DATA(variableCollection()->index(structIndex, 0, i), "ts"); |
| 1724 | COMPARE_DATA(variableCollection()->index(structIndex, 1, i), "{...}"); |
| 1725 | COMPARE_DATA(variableCollection()->index(0, 1, ts), "1"); |
| 1726 | |
| 1727 | session->run(); |
| 1728 | WAIT_FOR_STATE(session, IDebugSession::EndedState); |
| 1729 | } |
| 1730 | |
| 1731 | void DebuggerTestBase::testVariablesWatches() |
| 1732 | { |
nothing calls this directly
no test coverage detected