Fix broken tests.

This commit is contained in:
Roman Telezhynskyi 2023-05-09 18:59:32 +03:00
parent b845969fff
commit f5a7e85aae
6 changed files with 46 additions and 9 deletions

View File

@ -32,7 +32,9 @@
#include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/varc.h"
#include "../vlayout/vrawsapoint.h"
#include "../vmisc/testpath.h" // do not remove
#include "../vmisc/vabstractvalapplication.h"
#include "../vpatterndb/testpassmark.h" // do not remove
#include "vgeometrydef.h"
#include "vpassmark.h"
@ -674,9 +676,10 @@ auto VPassmark::SAPassmark(const QVector<QPointF> &seamAllowance, const QVector<
return {};
}
// DumpVector(seamAllowance, QStringLiteral("seamAllowance.json.XXXXXX")); // Uncomment for dumping test data
// DumpVector(seamAllowance, QStringLiteral("rotatedSeamAllowance.json.XXXXXX")); // Uncomment for dumping test data
// DumpPassmarkData(m_data, QStringLiteral("passmarkData.json.XXXXXX")); // Uncomment for dumping test data
// DumpVector(seamAllowance, QStringLiteral("seamAllowance.json.XXXXXX")); // Uncomment for dumping test data
// DumpVector(rotatedSeamAllowance,
// QStringLiteral("rotatedSeamAllowance.json.XXXXXX")); // Uncomment for dumping test data
// DumpPassmarkData(m_data, QStringLiteral("passmarkData.json.XXXXXX")); // Uncomment for dumping test data
QVector<QLineF> lines = SAPassmarkBaseLine(seamAllowance, rotatedSeamAllowance, side);
if (lines.isEmpty())

View File

@ -78,7 +78,7 @@ auto main(int argc, char **argv) -> int
QResource::registerResource(QCoreApplication::applicationDirPath() + QStringLiteral("/test_data.rcc"));
int status = 0;
auto ASSERT_TEST = [&status, argc, argv](QObject* obj)
auto ASSERT_TEST = [&status, argc, argv](QObject *obj)
{
status |= QTest::qExec(obj, argc, argv);
delete obj;

View File

@ -1,10 +1,12 @@
{
"data": {
"globalPassmarkLength": 0,
"globalPassmarkWidth": 0,
"id": 373,
"isMainPathNode": true,
"isShowSecondPassmark": true,
"nextSAPoint": {
"passmarkClockwiseOpening": false,
"saAfter": 37.795275590551185,
"saBefore": 0,
"turnPoint": true,
@ -17,6 +19,7 @@
"passmarkIndex": 0,
"passmarkLineType": 3,
"passmarkSAPoint": {
"passmarkClockwiseOpening": false,
"saAfter": 0,
"saBefore": 37.795275590551185,
"turnPoint": true,
@ -28,6 +31,7 @@
"previousSAPoint": {
"angle": 6,
"curvePoint": true,
"passmarkClockwiseOpening": false,
"saAfter": 37.795275590551185,
"saBefore": 37.795275590551185,
"type": "VSAPoint",

View File

@ -16,8 +16,8 @@
{
"p1": {
"type": "QPointF",
"x": -824.2011460276914,
"y": 346.4832618163752
"x": -821.3739639415661,
"y": 352.98150326249686
},
"p2": {
"type": "QPointF",
@ -25,6 +25,19 @@
"y": 359.4797447086185
},
"type": "QLineF"
},
{
"p1": {
"type": "QPointF",
"x": -818.5467818554408,
"y": 359.4797447086185
},
"p2": {
"type": "QPointF",
"x": -824.2011460276914,
"y": 346.4832618163752
},
"type": "QLineF"
}
]
}

View File

@ -1,10 +1,12 @@
{
"data": {
"globalPassmarkLength": 0,
"globalPassmarkWidth": 0,
"id": 435,
"isMainPathNode": true,
"isShowSecondPassmark": true,
"nextSAPoint": {
"passmarkClockwiseOpening": false,
"saAfter": 37.795275590551185,
"saBefore": 37.795275590551185,
"turnPoint": true,
@ -17,6 +19,7 @@
"passmarkIndex": 0,
"passmarkLineType": 3,
"passmarkSAPoint": {
"passmarkClockwiseOpening": false,
"saAfter": 37.795275590551185,
"saBefore": 37.795275590551185,
"turnPoint": true,
@ -28,6 +31,7 @@
"previousSAPoint": {
"angle": 6,
"curvePoint": true,
"passmarkClockwiseOpening": false,
"saAfter": 37.795275590551185,
"saBefore": 37.795275590551185,
"type": "VSAPoint",

View File

@ -16,8 +16,8 @@
{
"p1": {
"type": "QPointF",
"x": -838.454269371801,
"y": 334.6971977222692
"x": -835.4255113454269,
"y": 341.1039695504113
},
"p2": {
"type": "QPointF",
@ -25,6 +25,19 @@
"y": 347.5107413785534
},
"type": "QLineF"
},
{
"p1": {
"type": "QPointF",
"x": -832.3967533190528,
"y": 347.5107413785534
},
"p2": {
"type": "QPointF",
"x": -838.454269371801,
"y": 334.6971977222692
},
"type": "QLineF"
}
]
}