From: azv Date: Tue, 26 Jan 2016 12:21:31 +0000 (+0300) Subject: Update unit tests for the PlaneGCS solver. Bug fixes. X-Git-Tag: V_2.2.0~175 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=567415525ab82257650a14a124ab68cd48f07cc6;p=modules%2Fshaper.git Update unit tests for the PlaneGCS solver. Bug fixes. --- 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) #=========================================================================