]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[Code coverage FeaturesPlugin]: Unit tests for error messages
authorazv <azv@opencascade.com>
Thu, 6 Dec 2018 12:41:10 +0000 (15:41 +0300)
committerazv <azv@opencascade.com>
Thu, 6 Dec 2018 12:41:10 +0000 (15:41 +0300)
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py [new file with mode: 0644]

index b75d4a17cc0b26036896a98e69ec77f243dfea3a..b2f13027082e6d268db828722b7e986db50c5415 100644 (file)
@@ -171,11 +171,13 @@ INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 ADD_UNIT_TESTS(TestExtrusion.py
                TestExtrusionCut.py
                TestExtrusionFuse.py
+               TestExtrusion_ErrorMsg.py
                TestRevolution.py
                TestRevolutionCut.py
                TestRevolutionFuse.py
                TestCompositeFeaturesOnCompSolids.py
                TestPartition.py
+               TestPartition_ErrorMsg.py
                TestPlacement_Vertex_Vertex.py
                TestPlacement_Edge_Vertex.py
                TestPlacement_Edge_Edge.py
@@ -200,9 +202,12 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanFillWithPlane.py
                TestMultiBoolean.py
                TestSerialBoolean.py
+               TestBoolean_ErrorMsg.py
                TestIntersection.py
+               TestIntersection_ErrorMsg.py
                TestUnion.py
                TestUnionFaces.py
+               TestUnion_ErrorMsg.py
                TestRemoveSubShapes.py
                TestRemoveSubShapes2.py
                TestRemoveSubShapes3.py
@@ -325,8 +330,10 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanCut_WireCompound_WireCompound.py
                TestBooleanSmash_Face_Face.py
                TestBooleanSmash_SubSolid_Solid.py
+               TestBooleanSmash_ErrorMsg.py
                TestBooleanFuse_SimpleMode.py
                TestBooleanFuse_RemoveEdges.py
+               TestBooleanFuse_ErrorMsg.py
                TestBooleanCommon_Vertex_Vertex.py
                TestBooleanCommon_VertexCompound_VertexCompound.py
                TestBooleanCommon_Edge_Edge.py
@@ -352,6 +359,7 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanCommon_CompSolidCompound_Face.py
                TestBooleanCommon_CompSolidCompound_Shell.py
                TestBooleanCommon_CompSolidCompound_CompSolidCompound.py
+               TestBooleanCommon_ErrorMsg.py
                Test2596.py
                Test2592.py
                Test2588.py
@@ -388,6 +396,8 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanFuse_SolidCompound_SolidCompound.py
                TestBooleanFuse_CompSolid_CompSolid.py
                TestBooleanFuse_CompSolidCompound_CompSolidCompound.py
+               TestFillet.py
+               TestFillet_ErrorMsg.py
                Test1816.py
                Test2631.py
                Test2650.py
index 724b9d5abe645a1706f0ecb490330b4a192c218a..4f9b5f1f1d4379f0a86584382ff0bebc5db5dfad 100644 (file)
@@ -1168,75 +1168,44 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
     return false;
   }
 
-  int anObjectsNb = 0, aToolsNb = 0;
-  //int anOperationType = 0;
+  int anObjectsToolsNb[2] = { 0,  0 };
 
   std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
 
   bool isAllInSameCompSolid = true;
   ResultBodyPtr aCompSolid;
 
-  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    anObjectsNb = anAttrSelList->size();
-    for (int anIndex = 0; anIndex < anObjectsNb; ++anIndex)
+  for (int* anArgNbIt = anObjectsToolsNb; anIt != aLast; ++anIt, ++anArgNbIt) {
+    AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+    if (anAttrSelList)
     {
-      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-      ResultPtr aContext = anAttr->context();
-      ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-      if (aResCompSolidPtr.get())
-      {
-        if (aCompSolid.get())
-        {
-          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
-        }
-        else
-        {
-          aCompSolid = aResCompSolidPtr;
-        }
-      }
-      else
-      {
-        isAllInSameCompSolid = false;
-        break;
-      }
-    }
-  }
-  anIt++;
-
-
-  anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    aToolsNb = anAttrSelList->size();
-    if (isAllInSameCompSolid)
-    {
-      for (int anIndex = 0; anIndex < aToolsNb; ++anIndex)
-      {
-        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-        ResultPtr aContext = anAttr->context();
-        ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-        if (aResCompSolidPtr.get())
+      *anArgNbIt = anAttrSelList->size();
+      if (isAllInSameCompSolid) {
+        for (int anIndex = 0; anIndex < *anArgNbIt; ++anIndex)
         {
-          if (aCompSolid.get())
+          AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+          ResultPtr aContext = anAttr->context();
+          ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+          if (aResCompSolidPtr.get())
           {
-            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            if (aCompSolid.get())
+            {
+              isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            }
+            else
+            {
+              aCompSolid = aResCompSolidPtr;
+            }
           }
           else
           {
-            aCompSolid = aResCompSolidPtr;
+            isAllInSameCompSolid = false;
+            break;
           }
         }
-        else
-        {
-          isAllInSameCompSolid = false;
-          break;
-        }
       }
     }
   }
-  anIt++;
 
   std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theFeature);
@@ -1245,7 +1214,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   if (anOperationType == FeaturesPlugin_Boolean::BOOL_FUSE)
   {
     // Fuse operation
-    if (anObjectsNb + aToolsNb < 2)
+    if (anObjectsToolsNb[0] + anObjectsToolsNb[1] < 2)
     {
       theError = "Not enough arguments for Fuse operation.";
       return false;
@@ -1258,12 +1227,12 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   }
   else
   {
-    if (anObjectsNb < 1)
+    if (anObjectsToolsNb[0] < 1) // check number of objects
     {
       theError = "Objects not selected.";
       return false;
     }
-    if (aToolsNb < 1)
+    if (anObjectsToolsNb[1] < 1) // check number of tools
     {
       theError = "Tools not selected.";
       return false;
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py
new file mode 100644 (file)
index 0000000..06c97a5
--- /dev/null
@@ -0,0 +1,37 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+assert(Common_1.feature().error() != "")
+Part_1_doc.removeFeature(Common_1.feature())
+
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [])
+assert(Common_1.feature().error() != "")
+Part_1_doc.removeFeature(Common_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py
new file mode 100644 (file)
index 0000000..17441ab
--- /dev/null
@@ -0,0 +1,41 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1"), model.selection("FACE", "PartSet/XOZ")])
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py
new file mode 100644 (file)
index 0000000..b4a0fbc
--- /dev/null
@@ -0,0 +1,60 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_1")], [model.selection("SOLID", "Cylinder_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_1")])
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Cylinder_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], [model.selection("FACE", "Face_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(5, -6, 7)
+SketchCircle_2 = Sketch_1.addCircle(14, 0, 8)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("SOLID", "Extrusion_1_1_2")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/To_Face")])
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_2_1")], [model.selection("FACE", "Face_2_2")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py
new file mode 100644 (file)
index 0000000..17c34da
--- /dev/null
@@ -0,0 +1,42 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/YOZ"), model.selection("SOLID", "Cylinder_1_1")])
+
+Cut_1 = model.addCut(Part_1_doc, [], [])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py b/src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py
new file mode 100644 (file)
index 0000000..00819d0
--- /dev/null
@@ -0,0 +1,53 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 0, 0, 0)
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection(), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(20, 20, 10)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection("EDGE", "PartSet/OX"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OX"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchArc_1 = Sketch_2.addArc(25, 10, 40, 10, 25, 25, False)
+model.do()
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py b/src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py
new file mode 100644 (file)
index 0000000..92dfacd
--- /dev/null
@@ -0,0 +1,52 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-30, 5, 15)
+SketchLine_1 = Sketch_1.addLine(60, -30, 15, -30)
+SketchLine_2 = Sketch_1.addLine(15, -30, 15, 15)
+SketchLine_3 = Sketch_1.addLine(15, 15, 60, 15)
+SketchLine_4 = Sketch_1.addLine(60, 15, 60, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")], 2)
+assert(Fillet_1.feature().error() != "")
+Part_1_doc.removeFeature(Fillet_1.feature())
+
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_2/To_Face")], 2)
+assert(Fillet_1.feature().error() != "")
+Part_1_doc.removeFeature(Fillet_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py b/src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py
new file mode 100644 (file)
index 0000000..74b8b25
--- /dev/null
@@ -0,0 +1,35 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(10, -20, 15)
+model.do()
+
+Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+assert(Intersection_1.feature().error() != "")
+Part_1_doc.removeFeature(Intersection_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py b/src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py
new file mode 100644 (file)
index 0000000..40782a4
--- /dev/null
@@ -0,0 +1,47 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(60, -30, 15, -30)
+SketchLine_2 = Sketch_1.addLine(15, -30, 15, 15)
+SketchLine_3 = Sketch_1.addLine(15, 15, 60, 15)
+SketchLine_4 = Sketch_1.addLine(60, 15, 60, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+assert(Partition_1.feature().error() != "")
+Part_1_doc.removeFeature(Partition_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py b/src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py
new file mode 100644 (file)
index 0000000..5f5710a
--- /dev/null
@@ -0,0 +1,37 @@
+## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, -30, 15)
+SketchCircle_2 = Sketch_1.addCircle(10, -25, 10)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("COMPOUND", "Sketch_1")])
+assert(Union_1.feature().error() != "")
+Part_1_doc.removeFeature(Union_1.feature())
+
+model.end()