From: mpv Date: Mon, 17 Dec 2018 12:31:01 +0000 (+0300) Subject: Improve code coverage in PartSet plugin X-Git-Tag: End2018~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a7b701bf0530d9fbdb624150fa41676696860c3;p=modules%2Fshaper.git Improve code coverage in PartSet plugin --- diff --git a/src/ModelAPI/Test/TestFeatureSelection_2.py b/src/ModelAPI/Test/TestFeatureSelection_2.py index f4c21551e..e1d41a397 100644 --- a/src/ModelAPI/Test/TestFeatureSelection_2.py +++ b/src/ModelAPI/Test/TestFeatureSelection_2.py @@ -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) diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index 4eee01130..9b4c52589 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -97,7 +97,7 @@ std::shared_ptr 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(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(firstResult()); diff --git a/src/PartSetPlugin/PartSetPlugin_Plugin.cpp b/src/PartSetPlugin/PartSetPlugin_Plugin.cpp index 90e5548c2..3141f5273 100644 --- a/src/PartSetPlugin/PartSetPlugin_Plugin.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Plugin.cpp @@ -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& theMessage) { const Events_ID kRequestEvent = @@ -83,3 +84,4 @@ std::shared_ptr PartSetPlugin_Plugin::getFeaturesS aMsg->setState(PartSetPlugin_Remove::ID(), aDocIsPart); return aMsg; } +//LCOV_EXCL_STOP