From 567415525ab82257650a14a124ab68cd48f07cc6 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 26 Jan 2016 15:21:31 +0300 Subject: [PATCH] Update unit tests for the PlaneGCS solver. Bug fixes. --- src/SketchPlugin/Test/TestConstraintConcidence.py | 2 +- src/SketchPlugin/Test/TestConstraintMirror.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SketchPlugin/Test/TestConstraintConcidence.py b/src/SketchPlugin/Test/TestConstraintConcidence.py index 81e34ef70..43ef29837 100644 --- a/src/SketchPlugin/Test/TestConstraintConcidence.py +++ b/src/SketchPlugin/Test/TestConstraintConcidence.py @@ -133,7 +133,7 @@ aSession.startOperation() aDocument.removeFeature(aConstraint) aSession.finishOperation() aSession.startOperation() -aLineStartPoint.setValue(50., 0.) +aLineStartPoint.setValue(70., 0.) aSession.finishOperation() assert (anArcEndPoint.x() != aLineStartPoint.x() or anArcEndPoint.y() != aLineStartPoint.y()) diff --git a/src/SketchPlugin/Test/TestConstraintMirror.py b/src/SketchPlugin/Test/TestConstraintMirror.py index 6c3678970..319a725d6 100644 --- a/src/SketchPlugin/Test/TestConstraintMirror.py +++ b/src/SketchPlugin/Test/TestConstraintMirror.py @@ -22,6 +22,7 @@ __updated__ = "2015-03-17" # Auxiliary functions #========================================================================= def checkMirror(theListInit, theListMirr, theMirrorLine): + TOL = 1.e-8 aListSize = theListInit.size() aLineStartPoint = geomDataAPI_Point2D(theMirrorLine.attribute("StartPoint")) @@ -48,11 +49,11 @@ def checkMirror(theListInit, theListMirr, theMirrorLine): aDirX = aPointC.x() - aPointB.x() aDirY = aPointC.y() - aPointB.y() aDot = aLineDirX * aDirX + aLineDirY * aDirY - assert(math.fabs(aDot) < 1.e-10) + assert math.fabs(aDot) < TOL, "aDot = {0}".format(aDot) aDirX = aLineEndPoint.x() - 0.5 * (aPointB.x() + aPointC.x()) aDirY = aLineEndPoint.y() - 0.5 * (aPointB.y() + aPointC.y()) aCross = aLineDirX * aDirY - aLineDirY * aDirX - assert(math.fabs(aCross) < 1.e-10) + assert math.fabs(aCross) < TOL, "aCross = {0}".format(aCross) #========================================================================= -- 2.39.2