| 65 | } |
| 66 | |
| 67 | void hatchingOperationTest() |
| 68 | { |
| 69 | QFETCH(double, rotation); |
| 70 | QFETCH(double, offset); |
| 71 | QFETCH(QPointF, p0); |
| 72 | QFETCH(QPointF, p1); |
| 73 | |
| 74 | auto bounding_box = QRectF{ -60, -60, 120, 120 }; |
| 75 | auto spacing = 200.0; |
| 76 | QVarLengthArray<Record, 2> records; |
| 77 | auto recorder = makeRecorder(records); |
| 78 | Util::hatchingOperation(bounding_box, spacing, offset, qDegreesToRadians(rotation), recorder); |
| 79 | |
| 80 | const auto num_records = int(records.size()); |
| 81 | QCOMPARE(num_records, 1); |
| 82 | |
| 83 | auto& actual = records.front(); |
| 84 | if (!qFuzzyCompare(actual.p0.x(), bounding_box.left()) && !qFuzzyCompare(actual.p0.y(), bounding_box.top())) |
| 85 | std::swap(actual.p0, actual.p1); // normalize |
| 86 | QCOMPARE(actual.p0, p0); |
| 87 | QCOMPARE(actual.p1, p1); |
| 88 | } |
| 89 | |
| 90 | void hatchingOperationTest_data() |
| 91 | { |
nothing calls this directly
no test coverage detected