| 413 | } |
| 414 | |
| 415 | void TestBreakpointModel::testDocumentSave() |
| 416 | { |
| 417 | const auto [url, doc, b1] = setupPrimaryDocumentAndBreakpoint(); |
| 418 | RETURN_IF_TEST_FAILED(); |
| 419 | |
| 420 | // test. |
| 421 | b1->setLocation(url, 22); |
| 422 | auto* const b2 = breakpointModel()->addCodeBreakpoint(url, 24); |
| 423 | b2->setCondition("*i > 0"); |
| 424 | b2->setIgnoreHits(1); |
| 425 | printLines(21, 4, doc); |
| 426 | |
| 427 | const auto marks = documentMarks(doc); |
| 428 | QCOMPARE(marks.size(), 2); |
| 429 | VERIFY_BREAKPOINT(b1, 22, BreakpointModel::BreakpointMark, marks, ); |
| 430 | VERIFY_BREAKPOINT(b2, 24, BreakpointModel::BreakpointMark, marks, ); |
| 431 | |
| 432 | QVERIFY(doc->save()); |
| 433 | QVERIFY(doc->close()); |
| 434 | QCOMPARE(doc->state(), IDocument::Clean); |
| 435 | |
| 436 | // Wait needed for BreakpointModel::save() to complete. |
| 437 | QTest::qWait(1); |
| 438 | |
| 439 | // verify. |
| 440 | VERIFY_UNTRACKED_BREAKPOINT(b1, 22, ); |
| 441 | VERIFY_UNTRACKED_BREAKPOINT(b2, 24, ); |
| 442 | const auto savedBreakpoints = readBreakpointsFromConfig(); |
| 443 | QCOMPARE(savedBreakpoints.size(), 2); |
| 444 | QCOMPARE(savedBreakpoints.at(0)->line(), 22); |
| 445 | QCOMPARE(savedBreakpoints.at(1)->line(), 24); |
| 446 | QCOMPARE(savedBreakpoints.at(1)->condition(), "*i > 0"); |
| 447 | QCOMPARE(savedBreakpoints.at(1)->ignoreHits(), 1); |
| 448 | } |
| 449 | |
| 450 | void TestBreakpointModel::testDocumentEditAndSave() |
| 451 | { |
nothing calls this directly
no test coverage detected