]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crashes of unit-tests
authormpv <mpv@opencascade.com>
Wed, 7 Nov 2018 13:42:35 +0000 (16:42 +0300)
committermpv <mpv@opencascade.com>
Wed, 7 Nov 2018 13:42:35 +0000 (16:42 +0300)
src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp
src/FeaturesPlugin/Test/Test1379.py
src/Model/Model_AttributeSelection.cpp

index 4ac87606e659d9c0769bd44e7c421f3ddab6f00e..2f941d59e0034d74a4ced88dd54766a755faadac 100644 (file)
@@ -158,7 +158,7 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
       if(!aToShape.get() && aSelection->context().get()) {
         aToShape = aSelection->context()->shape();
       }
-      if (aToShape->isCompound()) {
+      if (aToShape.get() && aToShape->isCompound()) {
         GeomAPI_ShapeIterator anIt(aToShape);
         aToShape = anIt.current();
       }
@@ -169,7 +169,7 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
       if(!aFromShape.get() && aSelection->context().get()) {
         aFromShape = aSelection->context()->shape();
       }
-      if (aFromShape->isCompound()) {
+      if (aFromShape.get() && aFromShape->isCompound()) {
         GeomAPI_ShapeIterator anIt(aFromShape);
         aFromShape = anIt.current();
       }
index 6523d3b8a50634b26b461f3f077e36661dadca6a..9fdb8f1be5f8b201bc1ab7c5febb4129d235b543 100644 (file)
@@ -167,7 +167,7 @@ SketchConstraintDistance_7 = Sketch_2.setDistance(SketchLine_18.result(), Sketch
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 0.008999999999999999, 0.008999999999999999)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
-Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "(Extrusion_1_1/From_Face)7(Fuse_1_1/Modified_Face&Sketch_1/SketchArc_1_2)7(Extrusion_1_1/To_Face)7"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_7"))
 RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 10, 28, [model.selection("SOLID", "Fuse_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_19 = Sketch_3.addLine(0.029, 0.042, 0.029, 0.03267384683690003)
index b58e29461ef82fdd19d35a937feafab6803b77c8..77f6bb5fa5de16052e0f2c6f789966247f3876ef 100644 (file)
@@ -1442,7 +1442,7 @@ void Model_AttributeSelection::updateInHistory()
       if (aValueShape.get()) {
         aShapeShapeType = aValueShape->shapeType();
       } else {
-        (*aNewCont)->shape()->shapeType();
+        aShapeShapeType = (*aNewCont)->shape()->shapeType();
       }
       if (aListShapeType != GeomAPI_Shape::SHAPE && aListShapeType != aShapeShapeType) {
         continue;