From 5a7b701bf0530d9fbdb624150fa41676696860c3 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 17 Dec 2018 15:31:01 +0300 Subject: [PATCH] Improve code coverage in PartSet plugin --- src/ModelAPI/Test/TestFeatureSelection_2.py | 4 +++- src/PartSetPlugin/PartSetPlugin_Part.cpp | 4 ++-- src/PartSetPlugin/PartSetPlugin_Plugin.cpp | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) 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 -- 2.39.2