0022871: Step Reader raises exception on invalid entity (null swept curve)
authorika <ika@opencascade.com>
Fri, 26 Oct 2012 12:57:47 +0000 (16:57 +0400)
committerika <ika@opencascade.com>
Fri, 26 Oct 2012 12:57:47 +0000 (16:57 +0400)
checking for null swept curve was added
Adding test case

src/StepToGeom/StepToGeom_MakeCurve.cxx
tests/bugs/grids.list
tests/bugs/step/begin [new file with mode: 0755]
tests/bugs/step/bug22871 [new file with mode: 0755]

index 47daa5a..889a26b 100755 (executable)
@@ -52,6 +52,9 @@
 
 Standard_Boolean StepToGeom_MakeCurve::Convert (const Handle(StepGeom_Curve)& SC, Handle(Geom_Curve)& CC)
 {
+  if (SC.IsNull()){
+    return Standard_False;
+  }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
     const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC);
     return StepToGeom_MakeLine::Convert(L,*((Handle(Geom_Line)*)&CC));
index aa4e4ef..7f4041b 100755 (executable)
@@ -5,5 +5,5 @@
 005 xde
 006 modalg
 007 moddata
-
+008 step
 
diff --git a/tests/bugs/step/begin b/tests/bugs/step/begin
new file mode 100755 (executable)
index 0000000..548d4d3
--- /dev/null
@@ -0,0 +1,9 @@
+pload XDE
+
+
+
+
+
+
+
+
diff --git a/tests/bugs/step/bug22871 b/tests/bugs/step/bug22871
new file mode 100755 (executable)
index 0000000..a44050d
--- /dev/null
@@ -0,0 +1,15 @@
+puts "============"
+puts "CR22871"
+puts "============"
+puts ""
+#######################################################################
+# Step Reader raises exception on invalid entity (null swept curve)
+#######################################################################
+
+set info [stepread [locate_data_file bug22871_null-swept-curve.stp] s *]
+set check [lsearch $info Exception*]
+if { $check != -1 } {
+    puts "Error : Step Reader raises exception"
+}
+
+