Improve point comparison. Loose restrictions for distance between points. smart-pattern/valentina#103

- Instead of default value for accuracy use 1 mm. This should help to cover more false positive cases.
- All tests are now enabled on all platforms.
- Added calculation of a distance between points to see exactly how big is difference.
This commit is contained in:
Roman Telezhynskyi 2021-03-04 13:53:22 +02:00
parent 1b64cba897
commit 707e0e682d
10 changed files with 133 additions and 254 deletions

View File

@ -1,111 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<pattern>
<!--Pattern created with Valentina (http://www.valentina-project.org/).-->
<version>0.2.4</version>
<unit>cm</unit>
<author/>
<description/>
<notes/>
<measurements>mesures GAVAUDAN Laure.vit</measurements>
<increments/>
<draw name="Élément de patron 2">
<calculation>
<point id="1" mx="-1.96425" x="0.838148" y="1.01393" name="A" type="single" my="-1.2931"/>
<point id="2" basePoint="1" typeLine="hair" mx="1.11306" length="46" name="B" lineColor="black" type="endLine" angle="0" my="-1.69695"/>
<point id="3" basePoint="2" typeLine="hair" mx="0.132292" length="68" name="C" lineColor="black" type="endLine" angle="270" my="0.264583"/>
<point id="4" basePoint="3" typeLine="hair" mx="0.132292" length="46" name="D" lineColor="black" type="endLine" angle="180" my="0.264583"/>
<line id="5" firstPoint="1" typeLine="hair" secondPoint="4" lineColor="black"/>
<point id="6" firstPoint="1" typeLine="none" mx="-0.560014" secondPoint="2" length="22" name="K" lineColor="black" type="alongLine" my="-3.08156"/>
<point id="7" firstPoint="4" typeLine="none" mx="0.132292" secondPoint="3" length="22" name="L" lineColor="black" type="alongLine" my="0.264583"/>
<line id="8" firstPoint="7" typeLine="dashDotLine" secondPoint="6" lineColor="black"/>
<point id="9" firstPoint="1" typeLine="none" mx="-1.02155" secondPoint="6" length="8" name="BB" lineColor="black" type="alongLine" my="-2.67772"/>
<point id="10" firstPoint="2" typeLine="none" mx="-3.96385" secondPoint="6" length="8" name="BB1" lineColor="black" type="alongLine" my="-2.50464"/>
<point id="11" firstPoint="4" typeLine="none" mx="0.132292" secondPoint="7" length="8" name="BB2" lineColor="black" type="alongLine" my="0.264583"/>
<point id="12" firstPoint="3" typeLine="none" mx="0.132292" secondPoint="7" length="8" name="BB3" lineColor="black" type="alongLine" my="0.264583"/>
<line id="13" firstPoint="12" typeLine="dashDotDotLine" secondPoint="10" lineColor="black"/>
<line id="14" firstPoint="9" typeLine="dashDotDotLine" secondPoint="11" lineColor="black"/>
<point id="15" firstPoint="1" typeLine="none" mx="0.132292" secondPoint="4" length="@H_sommet_epaule_taille_DOS" name="G" lineColor="black" type="alongLine" my="0.264583"/>
<point id="16" firstPoint="2" typeLine="none" mx="0.25048" secondPoint="3" length="@H_sommet_epaule_taille_DOS" name="H" lineColor="black" type="alongLine" my="0.0873015"/>
<line id="17" firstPoint="15" typeLine="dashDotDotLine" secondPoint="16" lineColor="black"/>
<point id="19" firstPoint="2" typeLine="none" mx="0.132292" secondPoint="16" length="@H_sommet_épaule_ligne_poitrine" name="F" lineColor="black" type="alongLine" my="0.264583"/>
<point id="20" firstPoint="1" typeLine="none" mx="-0.635928" secondPoint="15" length="@H_sommet_épaule_ligne_poitrine" name="E" lineColor="black" type="alongLine" my="0.146395"/>
<line id="21" firstPoint="20" typeLine="dashDotDotLine" secondPoint="19" lineColor="black"/>
<point id="22" firstPoint="20" typeLine="none" mx="-1.59847" secondPoint="1" length="@H_ligne_poitrine_ligne_carrure" name="I" lineColor="black" type="alongLine" my="-1.12003"/>
<point id="23" firstPoint="19" typeLine="none" mx="1.17075" secondPoint="2" length="@H_ligne_poitrine_ligne_carrure" name="J" lineColor="black" type="alongLine" my="-1.00464"/>
<line id="24" firstPoint="22" typeLine="dashDotDotLine" secondPoint="23" lineColor="black"/>
<point id="25" firstPoint="20" typeLine="none" mx="0.132292" secondPoint="19" length="22" name="M" lineColor="black" type="alongLine" my="0.264583"/>
<point id="26" firstPoint="15" typeLine="none" mx="0.132292" secondPoint="16" length="22" name="N" lineColor="black" type="alongLine" my="0.264583"/>
<point id="27" firstPoint="26" typeLine="none" mx="0.132292" secondPoint="16" length="2" name="W" lineColor="black" type="alongLine" my="0.264583"/>
<point id="28" firstPoint="26" typeLine="none" mx="0.132292" secondPoint="15" length="2" name="X" lineColor="black" type="alongLine" my="0.264583"/>
<line id="29" firstPoint="27" typeLine="hair" secondPoint="25" lineColor="black"/>
<line id="30" firstPoint="28" typeLine="hair" secondPoint="25" lineColor="black"/>
<point id="31" firstPoint="27" typeLine="none" mx="0.132292" secondPoint="25" length="Line_W_M+4" name="Y" lineColor="black" type="alongLine" my="0.264583"/>
<line id="32" firstPoint="31" typeLine="hair" secondPoint="25" lineColor="black"/>
<point id="33" firstPoint="28" typeLine="none" mx="0.132292" secondPoint="25" length="Line_X_M+4" name="Z" lineColor="black" type="alongLine" my="0.264583"/>
<line id="34" firstPoint="33" typeLine="hair" secondPoint="25" lineColor="black"/>
<point id="35" firstPoint="3" typeLine="none" mx="-1.89213" secondPoint="7" length="25.75" name="Ab" lineColor="black" type="alongLine" my="0.404198"/>
<point id="36" firstPoint="4" typeLine="none" mx="0.132292" secondPoint="7" length="23.75" name="Aa" lineColor="black" type="alongLine" my="0.264583"/>
<point id="37" firstPoint="35" typeLine="hair" mx="0.132292" secondPoint="36" length="5" name="A1" lineColor="darkRed" type="normal" angle="0" my="0.264583"/>
<point id="38" firstPoint="36" typeLine="hair" mx="0.132292" secondPoint="12" length="5" name="A2" lineColor="black" type="normal" angle="0" my="0.264583"/>
<spline id="39" angle2="288.781" kAsm1="0.895078" kAsm2="1.0522" angle1="91.2766" point4="28" type="simple" point1="36" kCurve="1" color="black"/>
<spline id="40" angle2="88.1667" kAsm1="0.98307" kAsm2="1.03228" angle1="251.79" point4="35" type="simple" point1="27" kCurve="1" color="black"/>
<point id="41" firstPoint="2" typeLine="none" mx="0.0169077" secondPoint="10" length="7" name="R" lineColor="black" type="alongLine" my="-2.73541"/>
<point id="42" basePoint="2" typeLine="hair" mx="0.132292" length="7" name="S" lineColor="black" type="endLine" angle="270" my="0.264583"/>
<line id="43" firstPoint="41" typeLine="hair" secondPoint="42" lineColor="black"/>
<point id="44" firstPoint="41" typeLine="none" mx="3.65151" secondPoint="42" length="Line_R_S/2" name="BB4" lineColor="black" type="alongLine" my="-1.17772"/>
<point id="45" firstPoint="44" typeLine="hair" mx="0.132292" secondPoint="41" length="2.1" name="BB5" lineColor="black" type="normal" angle="0" my="0.264583"/>
<point id="46" firstPoint="19" typeLine="none" mx="0.132292" secondPoint="20" length="8" name="P" lineColor="black" type="alongLine" my="0.264583"/>
<arc id="47" radius="@Epaule_sommet_extremite" angle2="200" center="41" angle1="185" type="simple" color="black"/>
<arc id="49" radius="@point_poitrine_extremite_epaule" angle2="120" center="46" angle1="110" type="simple" color="black"/>
<point id="50" firstArc="49" mx="-2.8677" secondArc="47" crossPoint="1" name="T" type="pointOfIntersectionArcs" my="-0.946952"/>
<line id="52" firstPoint="50" typeLine="dashDotDotLine" secondPoint="46" lineColor="darkRed"/>
<point id="53" firstPoint="23" typeLine="none" mx="0.132292" secondPoint="22" length="(@Largeur_carrure_DVT+1)/2" name="V" lineColor="black" type="alongLine" my="0.264583"/>
<line id="54" firstPoint="50" typeLine="dashDotDotLine" secondPoint="41" lineColor="darkRed"/>
<point id="55" mx="-1.99161" p1Line2="46" p1Line1="41" name="BB6" type="lineIntersect" my="-5.8904" p2Line1="50" p2Line2="10"/>
<point id="56" firstPoint="55" typeLine="none" mx="0.132292" secondPoint="50" length="2.5" name="U" lineColor="black" type="alongLine" my="0.264583"/>
<line id="57" firstPoint="56" typeLine="dashDotDotLine" secondPoint="46" lineColor="darkRed"/>
<point id="58" mx="-1.99161" p1Line2="56" p1Line1="23" name="V2" type="lineIntersect" my="-1.90266" p2Line1="53" p2Line2="46"/>
<line id="74" firstPoint="53" typeLine="hair" secondPoint="58" lineColor="black"/>
<line id="75" firstPoint="50" typeLine="hair" secondPoint="56" lineColor="black"/>
<line id="76" firstPoint="56" typeLine="hair" secondPoint="46" lineColor="black"/>
<line id="77" firstPoint="46" typeLine="hair" secondPoint="53" lineColor="black"/>
<line id="78" firstPoint="53" typeLine="hair" secondPoint="50" lineColor="black"/>
</calculation>
<modeling>
<point id="59" idObject="28" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="60" idObject="26" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<spline id="61" idObject="40" inUse="true" type="modelingSpline"/>
<spline id="62" idObject="39" inUse="true" type="modelingSpline"/>
<point id="63" idObject="35" inUse="true" mx="-1.89213" type="modeling" my="0.404198"/>
<point id="65" idObject="1" inUse="true" mx="-1.96425" type="modeling" my="-1.2931"/>
<point id="66" idObject="2" inUse="true" mx="1.11306" type="modeling" my="-1.69695"/>
<point id="67" idObject="3" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="68" idObject="11" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="69" idObject="4" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="70" idObject="15" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="71" idObject="20" inUse="true" mx="-0.635928" type="modeling" my="0.146395"/>
<point id="72" idObject="22" inUse="true" mx="-1.59847" type="modeling" my="-1.12003"/>
<point id="79" idObject="50" inUse="true" mx="-2.8677" type="modeling" my="-0.946952"/>
<point id="80" idObject="56" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="81" idObject="58" inUse="true" mx="-1.99161" type="modeling" my="-1.90266"/>
<point id="82" idObject="46" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
<point id="83" idObject="53" inUse="true" mx="0.132292" type="modeling" my="0.264583"/>
</modeling>
<details>
<detail id="64" width="1" mx="0" supplement="1" closed="0" name="Détail" my="0">
<node idObject="59" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="60" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="61" reverse="0" mx="0" nodeType="Contour" type="NodeSpline" my="0"/>
<node idObject="62" reverse="0" mx="0" nodeType="Contour" type="NodeSpline" my="0"/>
<node idObject="63" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
</detail>
<detail id="84" width="1" mx="0" supplement="1" closed="0" name="Détail" my="0">
<node idObject="79" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="80" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="81" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="82" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
<node idObject="83" mx="0" nodeType="Contour" type="NodePoint" my="0"/>
</detail>
</details>
</draw>
</pattern>

View File

@ -1,53 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<vit>
<!--Measurements created with Valentina (http://www.valentina-project.org/).-->
<version>0.3.3</version>
<read-only>false</read-only>
<notes/>
<unit>cm</unit>
<pm_system>998</pm_system>
<personal>
<family-name>Gavaudan</family-name>
<given-name>Laure</given-name>
<birth-date>2003-10-08</birth-date>
<gender>female</gender>
<email/>
</personal>
<body-measurements>
<m value="156" description="hauteur totale" name="@Stature"/>
<m value="88" name="@Tour_poitrine"/>
<m value="0" name="@Tour_petites_hanches"/>
<m value="95" name="@Tour_grandes_hanches"/>
<m value="24" name="@H_sommet_épaule_ligne_poitrine"/>
<m value="20" name="@H_pointpoitrine_taille"/>
<m value="100" name="@H_taille_sol_DVT"/>
<m value="16" name="@Ecart_poitrine"/>
<m value="32" name="@Encolure_taille_DVT"/>
<m value="32" name="@Tour_cou"/>
<m value="14" name="@Largeur_encolure"/>
<m value="12" name="@Epaule_sommet_extremite"/>
<m value="24" name="@point_poitrine_extremite_epaule"/>
<m value="33" name="@Largeur_carrure_DVT"/>
<m value="35" name="@Largeur_carrure_dos"/>
<m value="21" name="@H_sommet_epaule_point_carrure_DVT"/>
<m value="44" name="@H_sommet_epaule_taille_DOS"/>
<m value="33.5" name="@Encolure_taille_DOS"/>
<m value="30" name="@Extremite_epaul_taille_DOS"/>
<m value="19" name="@Entournure_taille_COTE"/>
<m value="55" name="@L_bras"/>
<m value="30" name="@L_epaule_coude"/>
<m value="26" name="@Tour_Bras"/>
<m value="15.5" name="@Tour_poignet"/>
<m value="99" name="@H_taille_sol_COTE"/>
<m value="99.5" name="@H_taille_sol_DOS"/>
<m value="72" name="@H_entrejambe_sol"/>
<m value="28" name="@H_taille_montant"/>
<m value="39" name="@H_genou_sol"/>
<m value="58" name="@Tour_cuisse"/>
<m value="35.5" name="@Tour_genou"/>
<m value="35" name="@Tour_mollet"/>
<m value="22.5" name="@Tour_cheville"/>
<m value="11.5" name="@H_ligne_poitrine_ligne_carrure"/>
<m value="0" name="@M_1"/>
</body-measurements>
</vit>

View File

@ -274,15 +274,17 @@ void AbstractTest::Comparison(const QVector<QPointF> &ekv, const QVector<QPointF
{ {
// Begin comparison // Begin comparison
QCOMPARE(ekv.size(), ekvOrig.size());// First check if sizes equal QCOMPARE(ekv.size(), ekvOrig.size());// First check if sizes equal
const qreal testAccuracy = (1.0/*mm*/ / 25.4) * PrintDPI;
for (int i=0; i < ekv.size(); i++) for (int i=0; i < ekv.size(); i++)
{ {
const QPointF p1 = ekv.at(i); const QPointF p1 = ekv.at(i);
const QPointF p2 = ekvOrig.at(i); const QPointF p2 = ekvOrig.at(i);
const QString msg = QStringLiteral("Index: %1. Got '%2;%3', Expected '%4;%5'.") const QString msg = QStringLiteral("Index: %1. Got '%2;%3', Expected '%4;%5'. Distance between points %6 mm.")
.arg(i).arg(p1.x()).arg(p1.y()).arg(p2.x()).arg(p2.y()); .arg(i).arg(p1.x()).arg(p1.y()).arg(p2.x()).arg(p2.y())
.arg(UnitConvertor(QLineF(p1, p2).length(), Unit::Px, Unit::Mm));
// Check each point. Don't use comparison float values // Check each point. Don't use comparison float values
QVERIFY2(VFuzzyComparePoints(p1, p2), qUtf8Printable(msg)); QVERIFY2(VFuzzyComparePoints(p1, p2, testAccuracy), qUtf8Printable(msg));
} }
} }

View File

@ -0,0 +1,34 @@
{
"vector": [
{
"type": "VSAPoint",
"x": 99.86433649395012,
"y": 10.166060970128015
},
{
"type": "VSAPoint",
"x": 236.976230899601,
"y": 65.89294600598842
},
{
"type": "VSAPoint",
"x": 198.9294347511521,
"y": 172.04822599160408
},
{
"type": "VSAPoint",
"x": 260.3187756756982,
"y": 75.38014122578073
},
{
"type": "VSAPoint",
"x": 324.5363299638826,
"y": 101.48031496062993
},
{
"type": "VSAPoint",
"x": 29.858267716535437,
"y": 300.8503937007874
}
]
}

View File

@ -0,0 +1,24 @@
{
"vector": [
{
"type": "QPointF",
"x": 73.4038432255171,
"y": -41.386063334917424
},
{
"type": "QPointF",
"x": 404.34279917400556,
"y": 93.11865802402654
},
{
"type": "QPointF",
"x": -29.71419544696289,
"y": 386.7882190877889
},
{
"type": "QPointF",
"x": 73.4038432255171,
"y": -41.386063334917424
}
]
}

View File

@ -0,0 +1,34 @@
{
"vector": [
{
"type": "VSAPoint",
"x": 99.86433649395012,
"y": 10.166060970128015
},
{
"type": "VSAPoint",
"x": 236.976230899601,
"y": 65.89294600598842
},
{
"type": "VSAPoint",
"x": 198.9294347511521,
"y": 172.04822599160408
},
{
"type": "VSAPoint",
"x": 260.3187756756982,
"y": 75.38014122578073
},
{
"type": "VSAPoint",
"x": 324.5363299638826,
"y": 101.48031496062993
},
{
"type": "VSAPoint",
"x": 29.858267716535437,
"y": 300.8503937007874
}
]
}

View File

@ -0,0 +1,24 @@
{
"vector": [
{
"type": "QPointF",
"x": 46.94334995708405,
"y": -92.9381876399629
},
{
"type": "QPointF",
"x": 484.14926838412856,
"y": 84.75700108742315
},
{
"type": "QPointF",
"x": -89.28665861046107,
"y": 472.7260444747902
},
{
"type": "QPointF",
"x": 46.94334995708405,
"y": -92.9381876399629
}
]
}

View File

@ -129,5 +129,9 @@
<file>panties_case2/output.json</file> <file>panties_case2/output.json</file>
<file>smart_pattern_#99/input.json</file> <file>smart_pattern_#99/input.json</file>
<file>smart_pattern_#99/output.json</file> <file>smart_pattern_#99/output.json</file>
<file>Issue_548_case2/input.json</file>
<file>Issue_548_case2/output.json</file>
<file>Issue_548_case3/input.json</file>
<file>Issue_548_case3/output.json</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -116,12 +116,10 @@ void TST_VAbstractPiece::EquidistantRemoveLoop_data()
// https://bitbucket.org/dismine/valentina/issue/298/segmented-curve-isnt-selected-in-seam // https://bitbucket.org/dismine/valentina/issue/298/segmented-curve-isnt-selected-in-seam
// See file src/app/share/collection/TestPuzzle.val // See file src/app/share/collection/TestPuzzle.val
// Code should clean loops in path. // Code should clean loops in path.
#if !defined(Q_PROCESSOR_S390) && !defined(Q_PROCESSOR_S390_X)
ASSERT_TEST_CASE("Issue 298. Case1", ASSERT_TEST_CASE("Issue 298. Case1",
QStringLiteral("://Issue_298_case1/input.json"), QStringLiteral("://Issue_298_case1/input.json"),
QStringLiteral("://Issue_298_case1/output.json"), QStringLiteral("://Issue_298_case1/output.json"),
75.59055118110237 /*seam allowance width*/); 75.59055118110237 /*seam allowance width*/);
#endif
ASSERT_TEST_CASE("Issue 298. Case2", ASSERT_TEST_CASE("Issue 298. Case2",
QStringLiteral("://Issue_298_case2/input.json"), QStringLiteral("://Issue_298_case2/input.json"),
@ -138,16 +136,15 @@ void TST_VAbstractPiece::EquidistantRemoveLoop_data()
QStringLiteral("://Issue_548_case1/output.json"), QStringLiteral("://Issue_548_case1/output.json"),
11.338582677165354 /*seam allowance width (0.3 cm)*/); 11.338582677165354 /*seam allowance width (0.3 cm)*/);
// Disabled due to "undefined behavior" problem ASSERT_TEST_CASE("Issue 548. Case2",
#if !defined(Q_OS_WIN) && !defined(Q_CC_CLANG) && !defined(Q_PROCESSOR_X86_64) QStringLiteral("://Issue_548_case2/input.json"),
QTest::newRow("Issue 548. Case2") << InputPointsIssue548Case2() QStringLiteral("://Issue_548_case2/output.json"),
<< 37.795275590551185 // seam allowance width (1.0 cm) 37.795275590551185 /*seam allowance width (1.0 cm)*/);
<< OutputPointsIssue548Case2();
QTest::newRow("Issue 548. Case3") << InputPointsIssue548Case3() ASSERT_TEST_CASE("Issue 548. Case3",
<< 75.59055118110237 // seam allowance width (2.0 cm) QStringLiteral("://Issue_548_case3/input.json"),
<< OutputPointsIssue548Case3(); QStringLiteral("://Issue_548_case3/output.json"),
#endif 75.59055118110237 /*seam allowance width (2.0 cm)*/);
// See file src/app/share/collection/bugs/Issue_#646.val // See file src/app/share/collection/bugs/Issue_#646.val
ASSERT_TEST_CASE("Issue 646.", ASSERT_TEST_CASE("Issue 646.",
@ -343,13 +340,11 @@ void TST_VAbstractPiece::LayoutAllowanceRemoveLoop_data()
QStringLiteral("://smart_pattern_#58/output.json"), QStringLiteral("://smart_pattern_#58/output.json"),
18.897637795275593 /*seam allowance width (0.5 cm)*/); 18.897637795275593 /*seam allowance width (0.5 cm)*/);
#if !(defined(Q_OS_WIN) && defined(Q_PROCESSOR_X86_64))
// See file src/app/share/collection/test/smart_pattern_#99.val // See file src/app/share/collection/test/smart_pattern_#99.val
ASSERT_TEST_CASE("Incorrect fix of distortion", ASSERT_TEST_CASE("Incorrect fix of distortion",
QStringLiteral("://smart_pattern_#99/input.json"), QStringLiteral("://smart_pattern_#99/input.json"),
QStringLiteral("://smart_pattern_#99/output.json"), QStringLiteral("://smart_pattern_#99/output.json"),
28.346456692913389 /*seam allowance width*/); 28.346456692913389 /*seam allowance width*/);
#endif
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -946,11 +941,7 @@ void TST_VAbstractPiece::BrokenDetailEquidistant_data()
ekvOrig.append(QPointF(796.554931640625, 2597.28125)); ekvOrig.append(QPointF(796.554931640625, 2597.28125));
ekvOrig.append(QPointF(787.1898456692913, 1663.5186141732283)); ekvOrig.append(QPointF(787.1898456692913, 1663.5186141732283));
// Disabled due to "undefined behavior" problem
#if !defined(Q_OS_WIN) && !defined(Q_CC_CLANG) && !defined(Q_PROCESSOR_X86_64) && !defined(Q_PROCESSOR_S390) \
&& !defined(Q_PROCESSOR_S390_X)
QTest::newRow("GAVAUDAN Laure.") << points << 37.795275590551185 << ekvOrig; QTest::newRow("GAVAUDAN Laure.") << points << 37.795275590551185 << ekvOrig;
#endif
// See the file "collection/bugs/Issue_#604.val" (since 0.5.0) // See the file "collection/bugs/Issue_#604.val" (since 0.5.0)
ASSERT_TEST_CASE("Issue #604.", ASSERT_TEST_CASE("Issue #604.",
@ -964,13 +955,11 @@ void TST_VAbstractPiece::BrokenDetailEquidistant_data()
QStringLiteral("://Issue_627/output.json"), QStringLiteral("://Issue_627/output.json"),
56.692913385826778 /*seam allowance width*/); 56.692913385826778 /*seam allowance width*/);
#if !defined (Q_PROCESSOR_S390) && !defined(Q_PROCESSOR_S390_X)
// See the file "collection/bugs/Issue_#687.val" // See the file "collection/bugs/Issue_#687.val"
ASSERT_TEST_CASE("Issue #687.", ASSERT_TEST_CASE("Issue #687.",
QStringLiteral("://Issue_687/input.json"), QStringLiteral("://Issue_687/input.json"),
QStringLiteral("://Issue_687/output.json"), QStringLiteral("://Issue_687/output.json"),
37.795275590551185 /*seam allowance width*/); 37.795275590551185 /*seam allowance width*/);
#endif
// See private test cases in file jacket_issue_#767.val, piece "Fabric_TopCollar" // See private test cases in file jacket_issue_#767.val, piece "Fabric_TopCollar"
// Curve approximation scale 0.5 // Curve approximation scale 0.5
@ -1191,7 +1180,6 @@ void TST_VAbstractPiece::TestCorrectEquidistantPoints() const
Comparison(after, expect); Comparison(after, expect);
} }
#ifndef Q_OS_WIN
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TST_VAbstractPiece::PossibleInfiniteClearLoops_data() const void TST_VAbstractPiece::PossibleInfiniteClearLoops_data() const
{ {
@ -1308,7 +1296,6 @@ void TST_VAbstractPiece::PossibleInfiniteClearLoops() const
QVector<QPointF> res = VAbstractPiece::CheckLoops(path); QVector<QPointF> res = VAbstractPiece::CheckLoops(path);
Comparison(res, expect); Comparison(res, expect);
} }
#endif //#ifndef Q_OS_WIN
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TST_VAbstractPiece::Case3() const void TST_VAbstractPiece::Case3() const
@ -1337,64 +1324,6 @@ void TST_VAbstractPiece::Case5() const
QVERIFY(qFuzzyIsNull(result)); QVERIFY(qFuzzyIsNull(result));
} }
//---------------------------------------------------------------------------------------------------------------------
QVector<VSAPoint> TST_VAbstractPiece::InputPointsIssue548Case2() const
{
QVector<VSAPoint> points;
points << VSAPoint(99.86433649395013, 10.166060970128015);
points << VSAPoint(176.0178302829931, 57.36978169486653);
points << VSAPoint(115.46606095399079, 156.67924434657942);
points << VSAPoint(197.43414263641347, 70.64467660756823);
points << VSAPoint(247.18110236220474, 101.48031496062993);
points << VSAPoint(29.858267716535437, 300.85039370078744);
return points;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QPointF> TST_VAbstractPiece::OutputPointsIssue548Case2() const
{
QVector<QPointF> points;
points << QPointF(75.35612582031402, -49.49247429729551);
points << QPointF(207.99390662262346, 32.7230151178754);
points << QPointF(309.47290565612207, 95.62474281894228);
points << QPointF(34.78597607721976, 347.62014343263024);
points << QPointF(-13.438975506560153, 319.209057294505);
points << QPointF(75.35612582031402, -49.49247429729551);
return points;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<VSAPoint> TST_VAbstractPiece::InputPointsIssue548Case3() const
{
QVector<VSAPoint> points;
points += VSAPoint(99.86433649395013, 10.166060970128015);
points += VSAPoint(176.0178302829931, 57.36978169486653);
points += VSAPoint(115.46606095399079, 156.67924434657942);
points += VSAPoint(197.43414263641347, 70.64467660756823);
points += VSAPoint(247.18110236220474, 101.48031496062993);
points += VSAPoint(29.858267716535437, 300.85039370078744);
return points;
}
//---------------------------------------------------------------------------------------------------------------------
QVector<QPointF> TST_VAbstractPiece::OutputPointsIssue548Case3() const
{
QVector<QPointF> points;
points += QPointF(50.84791514667799, -109.15100956471929);
points += QPointF(220.96071459087483, -3.7066408675763003);
points += QPointF(371.76470895003956, 89.76917067725468);
points += QPointF(39.71368443790398, 394.38989316447305);
points += QPointF(-56.73621872965576, 337.56772088822254);
points += QPointF(50.84791514667799, -109.15100956471929);
return points;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QVector<QPointF> TST_VAbstractPiece::InputPointsCase3a() const QVector<QPointF> TST_VAbstractPiece::InputPointsCase3a() const
{ {

View File

@ -57,10 +57,8 @@ private slots:
void CorrectEquidistantPoints() const; void CorrectEquidistantPoints() const;
void TestCorrectEquidistantPoints_data(); void TestCorrectEquidistantPoints_data();
void TestCorrectEquidistantPoints() const; void TestCorrectEquidistantPoints() const;
#ifndef Q_OS_WIN // Disabled due to "undefined behavior" problem
void PossibleInfiniteClearLoops_data() const; void PossibleInfiniteClearLoops_data() const;
void PossibleInfiniteClearLoops() const; void PossibleInfiniteClearLoops() const;
#endif
private: private:
QVector<VSAPoint> InputPointsCase3() const; QVector<VSAPoint> InputPointsCase3() const;
@ -70,12 +68,6 @@ private:
void Case4() const; void Case4() const;
void Case5() const; void Case5() const;
QVector<VSAPoint> InputPointsIssue548Case2() const;
QVector<QPointF> OutputPointsIssue548Case2() const;
QVector<VSAPoint> InputPointsIssue548Case3() const;
QVector<QPointF> OutputPointsIssue548Case3() const;
QVector<QPointF> InputPointsCase3a() const; QVector<QPointF> InputPointsCase3a() const;
QVector<QPointF> InputPointsCase4a() const; QVector<QPointF> InputPointsCase4a() const;
QVector<QPointF> InputPointsCase5a() const; QVector<QPointF> InputPointsCase5a() const;