Gather breakpoint marks in the document. @return line numbers as int keys and BreakpointModel::MarkType (possibly a bitwise-or combination of) as mapped values.
| 124 | /// Gather breakpoint marks in the document. |
| 125 | /// @return line numbers as int keys and BreakpointModel::MarkType (possibly a bitwise-or combination of) as mapped values. |
| 126 | TestBreakpointModel::DocumentMarks TestBreakpointModel::documentMarks(const IDocument* doc) |
| 127 | { |
| 128 | DocumentMarks ret; |
| 129 | // if it is not possible to get marks, fail. |
| 130 | QVERIFY_RETURN(doc, ret); |
| 131 | auto* const textDocument = doc->textDocument(); |
| 132 | QVERIFY_RETURN(textDocument, ret); |
| 133 | |
| 134 | const auto marks = textDocument->marks(); |
| 135 | for (const auto* mark : marks) { |
| 136 | // mask to remove non-breakpoint mark type bits. |
| 137 | const auto type = mark->type & BreakpointModel::AllBreakpointMarks; |
| 138 | if (type) { |
| 139 | ret.insert(mark->line, static_cast<BreakpointModel::MarkType>(type)); |
| 140 | } |
| 141 | } |
| 142 | return ret; |
| 143 | } |
| 144 | |
| 145 | /// Print sections of example code. |
| 146 | /// Used for checking what edited text looks like when writing tests. |
nothing calls this directly
no test coverage detected