From: azv Date: Tue, 20 Aug 2019 07:57:03 +0000 (+0300) Subject: Improve code coverage metrics. X-Git-Tag: VEDF2019Lot4~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7de5c8e6406baa5fe74087a91ddb54b6d1754608;p=modules%2Fshaper.git Improve code coverage metrics. --- diff --git a/src/Config/Config_FeatureMessage.cpp b/src/Config/Config_FeatureMessage.cpp index fdc684cc3..47baeae2e 100644 --- a/src/Config/Config_FeatureMessage.cpp +++ b/src/Config/Config_FeatureMessage.cpp @@ -147,6 +147,7 @@ void Config_FeatureMessage::setPluginLibrary(const std::string& myPluginLibrary) this->myPluginLibrary = myPluginLibrary; } +// LCOV_EXCL_START bool Config_FeatureMessage::isUseInput() const { return myUseInput; @@ -176,7 +177,7 @@ bool Config_FeatureMessage::isApplyContinue() const { return myIsApplyContinue; } - +// LCOV_EXCL_STOP void Config_FeatureMessage::setUseInput(bool isUseInput) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp index b9af96713..10368e91e 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp @@ -173,8 +173,7 @@ void FeaturesPlugin_MultiTranslation::performOneDirection() } else { std::string anError; ListOfShape aListOfShape; - std::shared_ptr - aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList); + ListOfMakeShape aMakeShapeList; for (int i=0; i aTranslationAlgo( @@ -194,8 +193,12 @@ void FeaturesPlugin_MultiTranslation::performOneDirection() break; } aListOfShape.push_back(aTranslationAlgo->shape()); - aListOfTranslationAlgo->appendAlgo(aTranslationAlgo); + aMakeShapeList.push_back(aTranslationAlgo); } + + std::shared_ptr + aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList(aMakeShapeList)); + std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aListOfShape); ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); @@ -366,8 +369,7 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection() } else { std::string anError; ListOfShape aListOfShape; - std::shared_ptr - aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList); + ListOfMakeShape aMakeShapeList; for (int j=0; jshape()); - aListOfTranslationAlgo->appendAlgo(aTranslationAlgo); + aMakeShapeList.push_back(aTranslationAlgo); } } + + std::shared_ptr + aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList(aMakeShapeList)); + std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aListOfShape); ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); diff --git a/src/FiltersPlugin/Test/TestFilters.py b/src/FiltersPlugin/Test/TestFilters.py index c08497fe8..75b480faf 100644 --- a/src/FiltersPlugin/Test/TestFilters.py +++ b/src/FiltersPlugin/Test/TestFilters.py @@ -25,13 +25,13 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) -Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Top"), model.filters(Part_1_doc, [model.addFilter(name = "BelongsTo", args = []), model.addFilter(name = "HorizontalFaces")])]) +Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Box_1_1/Bottom"), model.filters(Part_1_doc, [model.addFilter(name = "BelongsTo", args = [model.selection("SOLID", "Box_1_1")]), model.addFilter(name = "HorizontalFaces"), model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "PartSet/XOY")])])]) model.end() aFactory = ModelAPI_Session.get().validators() GroupFeature = Group_1.feature() assert(aFactory.validate(GroupFeature)) -assert(GroupFeature.selectionList("group_list").size() == 2) +assert(GroupFeature.selectionList("group_list").size() == 1) assert(model.checkPythonDump()) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.cpp index 264c6bd30..24fc81624 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.cpp @@ -79,30 +79,8 @@ void GeomAlgoAPI_Sewing::build(const ListOfShape& theShapes) } //================================================================================================== -#include #include -typedef std::map MapFaceSolid; -static void facesBelongingToSolids(const GeomShapePtr& theShape, - MapFaceSolid& theShapeRelations) -{ - for (GeomAPI_ShapeExplorer aSolidExp(theShape, GeomAPI_Shape::SHELL); - aSolidExp.more(); aSolidExp.next()) { - GeomShapePtr aSolid = aSolidExp.current(); - for (GeomAPI_ShapeExplorer aFaceExp(aSolid, GeomAPI_Shape::FACE); - aFaceExp.more(); aFaceExp.next()) - theShapeRelations[aFaceExp.current()].push_back(aSolid); - } -} - -static bool isShapeInList(const GeomShapePtr& theShape, const ListOfShape& theList) -{ - for (ListOfShape::const_iterator anIt = theList.begin(); anIt != theList.end(); ++anIt) - if (theShape->isEqual(*anIt)) - return true; - return false; -} - void GeomAlgoAPI_Sewing::modified(const std::shared_ptr theShape, ListOfShape& theHistory) { diff --git a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp index 56f93b2bf..ca3ebc7a2 100644 --- a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp +++ b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp @@ -52,7 +52,7 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr