Salome HOME
[Code coverage GeomValidators]: Exclude "fool-tolerance" validations
authorazv <azv@opencascade.com>
Mon, 17 Dec 2018 06:58:23 +0000 (09:58 +0300)
committerazv <azv@opencascade.com>
Mon, 17 Dec 2018 06:58:23 +0000 (09:58 +0300)
src/GeomValidators/GeomValidators_BodyShapes.cpp
src/GeomValidators/GeomValidators_ConstructionComposite.cpp
src/GeomValidators/GeomValidators_Face.cpp
src/GeomValidators/GeomValidators_Intersected.cpp
src/GeomValidators/GeomValidators_MinObjectsSelected.cpp
src/GeomValidators/GeomValidators_NotSelfIntersected.cpp
src/GeomValidators/GeomValidators_ShapeType.cpp
src/GeomValidators/GeomValidators_ZeroOffset.cpp

index ff040cecb1c5e1965e47445620e8d830e2182605..90ba00ee071e8acf82abec44e479749c2605591b 100644 (file)
@@ -82,9 +82,11 @@ bool GeomValidators_BodyShapes::isValid(const AttributePtr& theAttribute,
       }
     }
   } else {
+// LCOV_EXCL_START
     theError = "Error: Attribute \"%1\" does not supported by this validator.";
     theError.arg(anAttributeType);
     return false;
+// LCOV_EXCL_STOP
   }
 
   return true;
index c065b0eb8b92a12e0c4d45fc46e5cfa633b4decd..a537671213928fd82212e0f16d27720da4fe3f7f 100644 (file)
@@ -32,10 +32,12 @@ bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttrib
 {
   bool aValid = true;
   if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
     aValid = false;
     theError = "The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return aValid;
+// LCOV_EXCL_STOP
   }
 
   AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
index 18cc1b1e684bec26c7f2f4360973ba5857fb35b2..69170232dd7c8cb7f489a09a92dbc04c57e62e36 100644 (file)
@@ -87,9 +87,11 @@ bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
 {
   std::string anAttributeType = theAttribute->attributeType();
   if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
     theError = "The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return false;
+// LCOV_EXCL_STOP
   }
 
   bool aValid = true;
index aeef9bd120cabd10a572bfd7e7df22bae3c403be..ed23b6a2bae0329a79af745c8c1a2f861cd023ee 100644 (file)
@@ -31,6 +31,7 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
                                          const std::list<std::string>& theArguments,
                                          Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (!theAttribute) {
     theError = "Error: empty selection.";
     return false;
@@ -40,6 +41,7 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
     theError = "Error: compare with nothing";
     return false;
   }
+// LCOV_EXCL_STOP
 
   FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
 
@@ -59,10 +61,12 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
   for (std::list<std::string>::const_iterator anIt = theArguments.begin();
        anIt != theArguments.end() && isOk; ++anIt) {
     aSelection = aFeature->selection(*anIt);
+// LCOV_EXCL_START
     if (!aSelection) {
       theError = "Error: incorrect type of attribute";
       return false;
     }
+// LCOV_EXCL_STOP
 
     GeomShapePtr aShape;
     if (aSelection)
index 8a7d171db46265395473cb69ce87cd13a9887850..cf30db5f93a85fbdc091ee25201b4f608d865bfb 100644 (file)
@@ -31,17 +31,21 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr<ModelAPI_F
                                                 Events_InfoMessage& theError) const
 {
   if(theArguments.size() != 2) {
+// LCOV_EXCL_START
     theError =
       "Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::string aSelectionListId = theArguments.front();
   AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId);
   if(!anAttrSelList.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get attribute \"%1\".";
     theError.arg(aSelectionListId);
     return false;
+// LCOV_EXCL_STOP
   }
   int anObjectsNb = anAttrSelList->size();
 
index aa017935d63ced7532dd32c0521f85cc9e0dde35..c4d491515f04469021f1b9bf8fb8374d4ad2d8d1 100644 (file)
@@ -32,10 +32,12 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
                                                 const std::list<std::string>& theArguments,
                                                 Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.empty()) {
     theError = "Error: empty selection.";
     return false;
   }
+// LCOV_EXCL_STOP
 
   for (std::list<std::string>::const_iterator anIt = theArguments.cbegin();
        anIt != theArguments.cend();
@@ -44,8 +46,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
     std::string anArgument = *anIt;
     AttributePtr anAttribute = theFeature->attribute(anArgument);
     if (!anAttribute.get()) {
+// LCOV_EXCL_START
       theError = std::string("Error: Feature does not contain attribute: ") + anArgument;
       return false;
+// LCOV_EXCL_STOP
     }
     if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
       AttributeSelectionListPtr anAttrSelectionList =
@@ -53,8 +57,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
       for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
         AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
         if (!anAttrSelection.get()) {
+// LCOV_EXCL_START
           theError = "Error: Empty attribute selection.";
           return false;
+// LCOV_EXCL_STOP
         }
         ResultPtr aContext = anAttrSelection->context();
         if (!aContext.get()) {
@@ -80,9 +86,11 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
         }*/
       }
     } else {
+// LCOV_EXCL_START
       theError = std::string("Error: validator does not support attribute with type: ")
         + anAttribute->attributeType();
       return false;
+// LCOV_EXCL_STOP
     }
   }
 
index a7638e7be7ad0e30441d7577daaf2a8b0ab9109a..18620d14ad4c6da44e58919b7287117bad77eea5 100755 (executable)
@@ -163,8 +163,10 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
         std::string anAttributeType = aRefAttr->attributeType();
         aValid = anAttributeType == GeomDataAPI_Point2D::typeId();
         if (!aValid) {
+// LCOV_EXCL_START
           theError = "Shape type is \"%1\", it should be \"%2\"";
           theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType));
+// LCOV_EXCL_STOP
         }
       }
     }
@@ -189,9 +191,11 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
     }
   }
   else {
+// LCOV_EXCL_START
     aValid = false;
     theError = "The attribute with the %1 type is not processed";
     theError.arg(anAttributeType);
+// LCOV_EXCL_STOP
   }
   if (aValid)
     theError = "";
index d6181783f4931cb7a9e647070e3c60d28dd5abfc..c5a1d8243eb0958799c42d9e4b51898eced72252 100644 (file)
@@ -40,10 +40,12 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
                                         const std::list<std::string>& theArguments,
                                         Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(theArguments.size() != 9) {
     theError = "Wrong number of validator arguments in xml(expected 9).";
     return false;
   }
+// LCOV_EXCL_STOP
 
   std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();