From 280a49b40a59dbfe25350866737532f267b2b106 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 18 Dec 2018 18:41:02 +0300 Subject: [PATCH] [Code coverage GeomAPI]: Improve coverage quality --- src/GeomAPI/GeomAPI_Box.cpp | 6 ------ src/GeomAPI/GeomAPI_Box.h | 3 --- src/GeomAPI/GeomAPI_Shape.cpp | 4 ++++ src/GeomAPI/Test/TestCone.py | 2 ++ src/GeomAPI/Test/TestCylinder.py | 1 + 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/GeomAPI/GeomAPI_Box.cpp b/src/GeomAPI/GeomAPI_Box.cpp index 68fe4db81..76189f460 100644 --- a/src/GeomAPI/GeomAPI_Box.cpp +++ b/src/GeomAPI/GeomAPI_Box.cpp @@ -43,12 +43,6 @@ struct Box #define MY_BOX implPtr() -//================================================================================================= -GeomAPI_Box::GeomAPI_Box() - : GeomAPI_Interface(new Box(std::shared_ptr(new GeomAPI_Ax3), 0., 0., 0.)) -{ -} - //================================================================================================= GeomAPI_Box::GeomAPI_Box(const std::shared_ptr& theCorner, const double theWidth, diff --git a/src/GeomAPI/GeomAPI_Box.h b/src/GeomAPI/GeomAPI_Box.h index c3c9673cc..07b9130a6 100644 --- a/src/GeomAPI/GeomAPI_Box.h +++ b/src/GeomAPI/GeomAPI_Box.h @@ -34,9 +34,6 @@ class GeomAPI_Pnt; class GeomAPI_Box : public GeomAPI_Interface { public: - /// Default constructor - GEOMAPI_EXPORT GeomAPI_Box(); - /// Creation of torus defined by center point, direction, major and minor radii GEOMAPI_EXPORT GeomAPI_Box(const std::shared_ptr& theCorner, const double theWidth, diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index c4f30b6d3..d7840b168 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -152,6 +152,7 @@ bool GeomAPI_Shape::isCompoundOfSolids() const return isAtLeastOne; } +// LCOV_EXCL_START GeomAPI_Shape::ShapeType GeomAPI_Shape::typeOfCompoundShapes() const { const TopoDS_Shape& aShape = const_cast(this)->impl(); @@ -168,6 +169,7 @@ GeomAPI_Shape::ShapeType GeomAPI_Shape::typeOfCompoundShapes() const } return (GeomAPI_Shape::ShapeType) aType; } +// LCOV_EXCL_STOP // adds the nopt-compound elements recursively to the list static void addSimpleToList(const TopoDS_Shape& theShape, NCollection_List& theList) @@ -609,6 +611,7 @@ GeomPointPtr GeomAPI_Shape::middlePoint() const return aMiddlePoint; } +// LCOV_EXCL_START std::string GeomAPI_Shape::getShapeStream() const { std::ostringstream aStream; @@ -616,6 +619,7 @@ std::string GeomAPI_Shape::getShapeStream() const BRepTools::Write(aShape, aStream); return aStream.str(); } +// LCOV_EXCL_STOP GeomShapePtr GeomAPI_Shape::intersect(const GeomShapePtr theShape) const { diff --git a/src/GeomAPI/Test/TestCone.py b/src/GeomAPI/Test/TestCone.py index 7c92fb34d..f389e91c4 100644 --- a/src/GeomAPI/Test/TestCone.py +++ b/src/GeomAPI/Test/TestCone.py @@ -77,6 +77,8 @@ def checkEllipseFace(theDocument, theFaceName, theFirstFocus, theSecondFocus, th def assertCone(theCone, theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight): assert(theCone is not None) + assert(theCone.isSemiInfinite() == False) + assert(theCone.isInfinite() == False) anApex = theCone.apex() anAxis = theCone.axis() assert(anApex.distance(theApex) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(anApex.x(), anApex.y(), anApex.z(), theApex.x(), theApex.y(), theApex.z()) diff --git a/src/GeomAPI/Test/TestCylinder.py b/src/GeomAPI/Test/TestCylinder.py index c423f72e1..9091faee8 100644 --- a/src/GeomAPI/Test/TestCylinder.py +++ b/src/GeomAPI/Test/TestCylinder.py @@ -29,6 +29,7 @@ TOLERANCE = 1.e-7 def assertCylinder(theCylinder, theLocation, theAxis, theRadius, theHeight): assert(theCylinder is not None) + assert(theCylinder.isInfinite() == False) aLoc = theCylinder.location() aDir = theCylinder.axis() assert(aLoc.distance(theLocation) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(aLoc.x(), aLoc.y(), aLoc.z(), theLocation.x(), theLocation.y(), theLocation.z()) -- 2.39.2