── Test: CommandRow ADDR span is valid ──
| 714 | |
| 715 | // ── Test: CommandRow ADDR span is valid ── |
| 716 | void testBaseAddressSpan() { |
| 717 | m_editor->applyDocument(m_result); |
| 718 | |
| 719 | // Set CommandRow text with ADDR value (simulates controller) |
| 720 | m_editor->setCommandRowText( |
| 721 | QStringLiteral("source\u25BE \u00B7 0xD87B5E5000")); |
| 722 | |
| 723 | // Line 0 is CommandRow |
| 724 | const LineMeta* lm = m_editor->metaForLine(0); |
| 725 | QVERIFY(lm); |
| 726 | QCOMPARE(lm->lineKind, LineKind::CommandRow); |
| 727 | |
| 728 | // Get CommandRow line text |
| 729 | QString lineText; |
| 730 | int len = (int)m_editor->scintilla()->SendScintilla( |
| 731 | QsciScintillaBase::SCI_LINELENGTH, (unsigned long)0); |
| 732 | if (len > 0) { |
| 733 | QByteArray buf(len + 1, '\0'); |
| 734 | m_editor->scintilla()->SendScintilla( |
| 735 | QsciScintillaBase::SCI_GETLINE, (unsigned long)0, (void*)buf.data()); |
| 736 | lineText = QString::fromUtf8(buf.constData(), len); |
| 737 | while (lineText.endsWith('\n') || lineText.endsWith('\r')) |
| 738 | lineText.chop(1); |
| 739 | } |
| 740 | |
| 741 | // ADDR span should be valid (uses commandRowAddrSpan) |
| 742 | ColumnSpan as = commandRowAddrSpan(lineText); |
| 743 | QVERIFY2(as.valid, "ADDR span should be valid on CommandRow"); |
| 744 | QVERIFY(as.start < as.end); |
| 745 | |
| 746 | // The span should cover the hex address |
| 747 | QString spanText = lineText.mid(as.start, as.end - as.start); |
| 748 | QVERIFY2(spanText.contains("0x") || spanText.startsWith("0X"), |
| 749 | qPrintable("Span should contain hex address, got: " + spanText)); |
| 750 | |
| 751 | m_editor->applyDocument(m_result); |
| 752 | } |
| 753 | |
| 754 | // ── Test: Padding line rejects value editing ── |
| 755 | void testPaddingLineRejectsValueEdit() { |
nothing calls this directly
no test coverage detected