Follow-up from "debugger: document reload and mark work"
The following discussions from !524 (merged) should be addressed:
-
@igorkushnir started a discussion: (+4 comments) I just noticed an unfortunate long chain of interleaving nested
Breakpoint
andBreakpointModel
calls:BreakpointModel::addCodeBreakpoint()
=>Breakpoint::setLocation()
=>Breakpoint::updateMovingCursor()
=>BreakpointModel::setupMovingCursor()
=>Breakpoint::setMovingCursor()
=>BreakpointModel::updateBreakpointMark()
. Ideally this back-and-forth should be refactored away (maybe not in this merge request). -
@igorkushnir started a discussion: (+19 comments) Check whether a type cast is needed here by making it fail (e.g. change the type to disabled-breakpoint) and learning whether
QCOMPARE
prints the actual and expected values. -
@igorkushnir started a discussion: (+23 comments) typo: "be not be"
Are
aboutToReload()
andreloaded()
emitted if user selects other than "Discard"? If not, why place this comment here? -
@igorkushnir started a discussion: (+12 comments) Just got this assertion to fail:
- Create a breakpoint.
- Remove all document text starting from some line above the breakpoint.
- Save the document.
- At this point the breakpoint's line is set to the number of lines in the document, which I think is wrong.
- Ctrl+Z to restore the removed text.
- Uncheck the invisible breakpoint's Enabled checkbox in the Breakpoints tool view.
ASSERT: "oldMarkType"
-
@igorkushnir started a discussion: (+3 comments) When I try to break the tests by changing the expected enumerator, I get uninformative
QCOMPARE
output:FAIL! : TestBreakpointModel::testUpdateMarkType() Compared values are not the same Loc: [/home/Fast_storage/kdevelop/kdevplatform/debugger/tests/test_breakpointmodel.cpp(487)] FAIL! : TestBreakpointModel::testDocumentReload() Compared values are not the same Loc: [/home/Fast_storage/kdevelop/kdevplatform/debugger/tests/test_breakpointmodel.cpp(518)]
This is a general problem with enums. Maybe add template specializations into this cpp file, e.g.:
namespace QTest { template<> inline char* toString(const IDocument::DocumentState& state) { return toString(static_cast<int>(state)); } }
(the
DocumentState
specialization can actually be inserted into kdevplatform/tests/testhelpers.h in a separate commit)