]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix instability in unit-test checking coincidence with ellipse.
authorazv <azv@opencascade.com>
Mon, 23 Sep 2019 07:08:45 +0000 (10:08 +0300)
committerazv <azv@opencascade.com>
Mon, 23 Sep 2019 07:19:46 +0000 (10:19 +0300)
src/Model/Model_Update.cpp
src/SketchPlugin/Test/TestConstraintCoincidenceEllipse.py

index 07f87c3edadc54194c031f07628d568c490c5fbe..d8896e68039a01774be036a7720ca08e9a9b1f8e 100644 (file)
@@ -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
index 1b5944d08c985c1fbebbcb7f4b66028ec751c17d..16f0f8ab4677477de3c5c21956f2e92b515d6609 100644 (file)
@@ -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()