MCPcopy Create free account
hub / github.com/KDE/labplot / updateLinesWithGapDirectConnection

Method updateLinesWithGapDirectConnection

tests/backend/XYCurve/XYCurveTest.cpp:1712–1737  ·  view source on GitHub ↗

###################################################################################### With Gap, skipGaps = false ######################################################################################

Source from the content-addressed store, hash-verified

1710// With Gap, skipGaps = false
1711// ######################################################################################
1712void XYCurveTest::updateLinesWithGapDirectConnection() {
1713 LOAD_PROJECT
1714 withGapCurve2->setLineSkipGaps(true);
1715 bool updateLinesCalled = false;
1716 connect(withGapCurve2, &XYCurve::linesUpdated, [withGapCurve2Private, &updateLinesCalled](const XYCurve* /*curve*/, const QVector<QLineF>& /*lines*/) {
1717 updateLinesCalled = true;
1718 QVector<QLineF> refLines{
1719 QLineF(QPointF(1, 1), QPointF(2, 2)),
1720 QLineF(QPointF(2, 2), QPointF(3, 3)),
1721 QLineF(QPointF(3, 3), QPointF(4, 7)),
1722 QLineF(QPointF(6, 3), QPointF(7, -10)),
1723 QLineF(QPointF(7, -10), QPointF(8, 0)),
1724 QLineF(QPointF(8, 0), QPointF(9, 5)),
1725 QLineF(QPointF(9, 5), QPointF(10, 8)),
1726 };
1727 QCOMPARE(withGapCurve2Private->m_logicalPoints.size() - 2, refLines.size()); // one point will be skipped, so 2 lines less
1728 auto test_lines = withGapCurve2Private->m_lines;
1729 QCOMPARE(refLines.size(), test_lines.size());
1730 for (int i = 0; i < test_lines.size(); i++) {
1731 COMPARE_LINES(test_lines.at(i), refLines.at(i));
1732 }
1733 });
1734
1735 withGapCurve2->setLineSkipGaps(false);
1736 QCOMPARE(updateLinesCalled, true);
1737}
1738
1739void XYCurveTest::updateLinesWithGapStartHorizontal() {
1740 LOAD_PROJECT

Callers

nothing calls this directly

Calls 3

setLineSkipGapsMethod · 0.80
QPointFClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected