From b6ebd6ceb90facbbf02af91198bec7ad3ca54f1f Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 17 Dec 2018 17:05:41 +0300 Subject: [PATCH] Improve code coverage in PartSet plugin --- src/PartSetPlugin/PartSetPlugin_Duplicate.h | 6 +++--- src/PartSetPlugin/PartSetPlugin_Part.cpp | 4 ---- src/PartSetPlugin/PartSetPlugin_Part.h | 4 +++- src/PartSetPlugin/PartSetPlugin_Remove.h | 2 ++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.h b/src/PartSetPlugin/PartSetPlugin_Duplicate.h index c85c01a02..ef320d8bd 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.h +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.h @@ -38,12 +38,14 @@ class PartSetPlugin_Duplicate : public ModelAPI_Feature static const std::string MY_REMOVE_KIND("Duplicate"); return MY_REMOVE_KIND; } +//LCOV_EXCL_START /// Returns the kind of a feature PARTSETPLUGIN_EXPORT virtual const std::string& getKind() { static std::string MY_KIND = PartSetPlugin_Duplicate::ID(); return MY_KIND; } +//LCOV_EXCL_STOP /// Returns to which group in the document must be added feature PARTSETPLUGIN_EXPORT virtual const std::string& getGroup() @@ -53,9 +55,7 @@ class PartSetPlugin_Duplicate : public ModelAPI_Feature } /// Request for initialization of data model of the feature: adding all attributes - PARTSETPLUGIN_EXPORT virtual void initAttributes() - { - } + PARTSETPLUGIN_EXPORT virtual void initAttributes() {} /// Not normal feature that stored in the tree PARTSETPLUGIN_EXPORT virtual bool isAction() diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index 9b4c52589..06d4641b9 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -120,10 +120,6 @@ bool PartSetPlugin_Part::isSub(ObjectPtr theObject) const return false; } -void PartSetPlugin_Part::removeFeature(std::shared_ptr theFeature) -{ -} - void PartSetPlugin_Part::erase() { ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { diff --git a/src/PartSetPlugin/PartSetPlugin_Part.h b/src/PartSetPlugin/PartSetPlugin_Part.h index 8a79e0d88..8abf2dca1 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.h +++ b/src/PartSetPlugin/PartSetPlugin_Part.h @@ -45,12 +45,14 @@ class PartSetPlugin_Part : public ModelAPI_CompositeFeature return MY_KIND; } +//LCOV_EXCL_START /// Returns to which group in the document must be added feature PARTSETPLUGIN_EXPORT virtual const std::string& getGroup() { static std::string MY_GROUP = "Parts"; return MY_GROUP; } +//LCOV_EXCL_STOP /// Creates a new part document if needed PARTSETPLUGIN_EXPORT virtual void execute(); @@ -80,7 +82,7 @@ class PartSetPlugin_Part : public ModelAPI_CompositeFeature /// This method to inform that sub-feature is removed and must be removed from the internal data /// structures of the owner (the remove from the document will be done outside just after) - virtual void removeFeature(std::shared_ptr theFeature); + virtual void removeFeature(std::shared_ptr theFeature) {} /// Use plugin manager for features creation PartSetPlugin_Part(); diff --git a/src/PartSetPlugin/PartSetPlugin_Remove.h b/src/PartSetPlugin/PartSetPlugin_Remove.h index f24d30e2f..58fc7ffa2 100644 --- a/src/PartSetPlugin/PartSetPlugin_Remove.h +++ b/src/PartSetPlugin/PartSetPlugin_Remove.h @@ -37,6 +37,7 @@ class PartSetPlugin_Remove : public ModelAPI_Feature static const std::string MY_REMOVE_KIND("Remove"); return MY_REMOVE_KIND; } +//LCOV_EXCL_START /// Returns the kind of a feature PARTSETPLUGIN_EXPORT virtual const std::string& getKind() { @@ -55,6 +56,7 @@ class PartSetPlugin_Remove : public ModelAPI_Feature PARTSETPLUGIN_EXPORT virtual void initAttributes() { } +//LCOV_EXCL_STOP /// Not normal feature that stored in the tree PARTSETPLUGIN_EXPORT virtual bool isAction() -- 2.39.2