Fix broken tests. ref #768.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-10-11 14:22:10 +03:00
parent baa2f4fd92
commit a2ebd5bb68
3 changed files with 27 additions and 5 deletions

View file

@ -173,6 +173,7 @@ void TST_VArc::TestGetPoints()
const VPointF center;
VArc arc(center, radius, startAngle, endAngle);
arc.SetApproximationScale(10);
QVector<QPointF> points = arc.GetPoints();

View file

@ -84,7 +84,11 @@ void TST_VPiece::ClearLoop()
points.append(p);
}
data->UpdateGObject(308, new VSplinePath(points));
{
VSplinePath *path = new VSplinePath(points);
path->SetApproximationScale(10);
data->UpdateGObject(308, path);
}
data->UpdateGObject(309, new VPointF(799.45989815267649, 850.6707401574804, "Г8", -30.431206299212597,
29.487155905511813));
@ -258,11 +262,18 @@ void TST_VPiece::Issue620()
points.append(p);
}
data->UpdateGObject(7, new VSplinePath(points));
{
VSplinePath *path = new VSplinePath(points);
path->SetApproximationScale(10);
data->UpdateGObject(7, path);
}
data->UpdateGObject(8, new VSpline(*p4, *p5, 59.932499999999997, "59.9325", 257.56999999999999,
"257.57", 170.46425196850396, "4.5102", 150.6164409448819,
"3.98506"));
{
VSpline *spl = new VSpline(*p4, *p5, 59.932499999999997, "59.9325", 257.56999999999999,
"257.57", 170.46425196850396, "4.5102", 150.6164409448819, "3.98506");
spl->SetApproximationScale(10);
data->UpdateGObject(8, spl);
}
VPiece detail;
detail.SetSeamAllowance(false);

View file

@ -46,6 +46,7 @@ void TST_VSpline::GetSegmentPoints()
VPointF p4(681.33729132409951, 1815.7969526662778, "p4", 5.0000125984251973, 9.9999874015748045);
VSpline spl(p1, p4, 229.381, 41.6325, 0.96294100000000005, 1.00054, 1);
spl.SetApproximationScale(10);
QPointF begin(957.69885233364062, 943.84482037833141);
QPointF end(681.33729132409951, 1815.7969526662778);
@ -173,6 +174,7 @@ void TST_VSpline::GetSegmentPoints_issue412()
VPointF p4(491.16472440944887, 316.83552755905515, "p4", 5.0000125984251973, 9.9999874015748045);
VSpline spl(p1, p4, 270, 0, 1, 1, 1);
spl.SetApproximationScale(10);
QPointF begin(869.11748031496063, -61.117228346456692);
QPointF end(758.41768107838425, 206.13572832247544);
@ -262,6 +264,7 @@ void TST_VSpline::GetSegmentPoints_TestPuzzle()
VPointF p4(681.33729132409951, 1815.7969526662778, "p4", 5.0000125984251973, 9.9999874015748045);
VSpline spl(p1, p4, 229.381, 41.6325, 0.96294100000000005, 1.00054, 1);
spl.SetApproximationScale(10);
QPointF begin(1168.85828031, 39.9998740157);
QPointF end(957.69883966, 943.844812978);
@ -381,6 +384,7 @@ void TST_VSpline::GetSegmentPoints_NullSegment()
const VPointF p4(182.31062201967654, 383.80617135964712, "A2", 5.0000125984251973, 9.9999874015748045);
VSpline spl(p1, p2, p3, p4, 1);
spl.SetApproximationScale(10);
const QPointF begin (146.3718263928647, 6.419281580065625);
const QPointF end (146.3718263928647, 6.419281580065625);
@ -536,6 +540,7 @@ void TST_VSpline::GetSegmentPoints_RotateTool()
VSpline spl(p1, p4, 231.11199999999994, "231.112", 145.33899999999997, "145.339", 207.44768503937021, "5.48872",
337.50916535433066, "8.92993");
spl.SetApproximationScale(10);
const QPointF begin(237.32422843061005, 485.80074940371367);
const QPointF end (46.623829088412336, 167.78988631718659);
@ -693,9 +698,14 @@ void TST_VSpline::CompareThreeWays()
VPointF p4(681.33729132409951, 1815.7969526662778, "p4", 5.0000125984251973, 9.9999874015748045);
VSpline spl1(p1, p4, 229.381, 41.6325, 0.96294100000000005, 1.00054, 1);
spl1.SetApproximationScale(10);
VSpline spl2(spl1.GetP1(), static_cast<QPointF>(spl1.GetP2()), static_cast<QPointF>(spl1.GetP3()), spl1.GetP4(), 1);
spl2.SetApproximationScale(10);
VSpline spl3(spl1.GetP1(), spl1.GetP4(), spl1.GetStartAngle(), "", spl2.GetEndAngle(), "", spl2.GetC1Length(), "",
spl2.GetC2Length(), "", 1);
spl3.SetApproximationScale(10);
QWARN("Comparing first and second splines.");
CompareSplines(spl1, spl2);