From: azv Date: Mon, 23 Sep 2019 07:08:45 +0000 (+0300) Subject: Fix instability in unit-test checking coincidence with ellipse. X-Git-Tag: V9_4_0a2~4^2~72 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8362ca77ab6a97d18f3c0264be96468d75c8089;p=modules%2Fshaper.git Fix instability in unit-test checking coincidence with ellipse. --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 07f87c3ed..d8896e680 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -647,7 +647,12 @@ bool Model_Update::processFeature(FeaturePtr theFeature) } // searching for the next not used reason aProcessedReasons.insert(aReason); - aReasons.erase(aReason); + // check theFeature is still in the list of modified, because it may be removed sometimes + // while updating SketchPlugin_Ellipse + if (myModified.find(theFeature) != myModified.end()) + aReasons.erase(aReason); + else + break; } // restore the modified reasons: they will be used in the update of arguments if (allSubsUsed) { // restore theFeature in this set diff --git a/src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py b/src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py index 1b5944d08..16f0f8ab4 100644 --- a/src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py +++ b/src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py @@ -219,7 +219,7 @@ class TestCoincidenceEllipse(unittest.TestCase): # move ellipse and set coincidence once again model.begin() - self.mySketch.move(self.myCenter, 20, 10) + self.mySketch.move(self.myMinorStart, 20, 10) model.do() self.mySketch.setCoincident(self.myMinorAxis.results()[-1], self.myOrigin.coordinates()) model.do()