]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update unit tests for the PlaneGCS solver. Bug fixes.
authorazv <azv@opencascade.com>
Tue, 26 Jan 2016 12:21:31 +0000 (15:21 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:30 +0000 (17:04 +0300)
src/SketchPlugin/Test/TestConstraintConcidence.py
src/SketchPlugin/Test/TestConstraintMirror.py

index 81e34ef70677d0cc3f38547135d6178809c517bf..43ef29837712a4dc19db8ccfecb06da66cf5524b 100644 (file)
@@ -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())
 
index 6c36789708f6f781bcaa7a1e207640dfda02ccd4..319a725d6cf4c2112bebc2685985de69488aa9c8 100644 (file)
@@ -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)
 
 
 #=========================================================================