]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improve code coverage in PartSet plugin
authormpv <mpv@opencascade.com>
Mon, 17 Dec 2018 12:31:01 +0000 (15:31 +0300)
committermpv <mpv@opencascade.com>
Mon, 17 Dec 2018 12:31:01 +0000 (15:31 +0300)
src/ModelAPI/Test/TestFeatureSelection_2.py
src/PartSetPlugin/PartSetPlugin_Part.cpp
src/PartSetPlugin/PartSetPlugin_Plugin.cpp

index f4c21551e9274d80db5df3a8d9a57dc9cc632ddb..e1d41a397a10728d431e86842dc411c2282e9a73 100644 (file)
@@ -56,7 +56,9 @@ model.do()
 
 # update the parameter N => number of sketch contours is changed
 Param_N.setValue(4)
-Part_1_doc.setCurrentFeature(Cut_1.feature(), False)
+Part_1_doc.setCurrentFeature(None, True)
+model.do()
+Part_1_doc.setCurrentFeature(Cut_1.feature(), True)
 model.end()
 
 assert(Cut_1.result().numberOfSubs() == 4)
index 4eee01130ea56cad1a35f415f88a224171b7bc55..9b4c5258951939b9696008bb6a7afcde36623d54 100644 (file)
@@ -97,7 +97,7 @@ std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Part::subFeature(const int theIn
   }
   return FeaturePtr();
 }
-
+//LCOV_EXCL_START
 int PartSetPlugin_Part::subFeatureId(const int theIndex) const
 {
   ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
@@ -109,7 +109,7 @@ int PartSetPlugin_Part::subFeatureId(const int theIndex) const
   }
   return 0; // none
 }
-
+//LCOV_EXCL_STOP
 bool PartSetPlugin_Part::isSub(ObjectPtr theObject) const
 {
   ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
index 90e5548c2ab306cfa4300e9d4fb08664f575a669..3141f52739e62e2866e7ae1ee3a6ac9b65ce30c5 100644 (file)
@@ -55,7 +55,8 @@ FeaturePtr PartSetPlugin_Plugin::createFeature(std::string theFeatureID)
   // feature of such kind is not found
   return FeaturePtr();
 }
-
+// used only in GUI
+//LCOV_EXCL_START
 void PartSetPlugin_Plugin::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   const Events_ID kRequestEvent =
@@ -83,3 +84,4 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> PartSetPlugin_Plugin::getFeaturesS
   aMsg->setState(PartSetPlugin_Remove::ID(), aDocIsPart);
   return aMsg;
 }
+//LCOV_EXCL_STOP