Just make sure that all input lines are in the output too, exactly once.
| 1572 | |
| 1573 | // Just make sure that all input lines are in the output too, exactly once. |
| 1574 | void Diff3LineList::debugLineCheck(const LineType size, const e_SrcSelector srcSelector) const |
| 1575 | { |
| 1576 | //FIXME:Does not work when m_pOptions->m_bDiff3AlignBC is set. |
| 1577 | LineType i = 0; |
| 1578 | |
| 1579 | for(const Diff3Line &entry: *this) |
| 1580 | { |
| 1581 | LineRef line; |
| 1582 | |
| 1583 | assert(srcSelector == e_SrcSelector::A || srcSelector == e_SrcSelector::B || srcSelector == e_SrcSelector::C); |
| 1584 | if(srcSelector == e_SrcSelector::A) |
| 1585 | line = entry.getLineA(); |
| 1586 | else if(srcSelector == e_SrcSelector::B) |
| 1587 | line = entry.getLineB(); |
| 1588 | else if(srcSelector == e_SrcSelector::C) |
| 1589 | line = entry.getLineC(); |
| 1590 | |
| 1591 | if(line.isValid()) |
| 1592 | { |
| 1593 | if(line != i) |
| 1594 | { |
| 1595 | #ifndef AUTOTEST |
| 1596 | KMessageBox::error(nullptr, i18n("Data loss error:\n" |
| 1597 | "If it is reproducible please contact the author.\n"), |
| 1598 | i18n("Severe Internal Error")); |
| 1599 | #endif |
| 1600 | |
| 1601 | qCCritical(kdiffMain) << "Severe Internal Error." << " line != i for srcSelector=" << (qint32)srcSelector << "\n"; |
| 1602 | ::exit(-1); |
| 1603 | } |
| 1604 | ++i; |
| 1605 | } |
| 1606 | } |
| 1607 | |
| 1608 | if(size != i) |
| 1609 | { |
| 1610 | #ifndef AUTOTEST |
| 1611 | KMessageBox::error(nullptr, i18n( |
| 1612 | "Data loss error:\n" |
| 1613 | "If it is reproducible please contact the author.\n"), |
| 1614 | i18n("Severe Internal Error")); |
| 1615 | #endif |
| 1616 | |
| 1617 | qCCritical(kdiffMain) << "Severe Internal Error.: " << size << " != " << i << "\n"; |
| 1618 | ::exit(-1); |
| 1619 | } |
| 1620 | } |
| 1621 | |
| 1622 | void Diff3LineList::findHistoryRange(const QRegularExpression& historyStart, bool bThreeFiles, HistoryRange& range) const |
| 1623 | { |