From f8362ca77ab6a97d18f3c0264be96468d75c8089 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 23 Sep 2019 10:08:45 +0300 Subject: [PATCH] Fix instability in unit-test checking coincidence with ellipse. --- src/Model/Model_Update.cpp | 7 ++++++- src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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() -- 2.39.2