0023429: BRepFeat_SplitShape algorithm misses some section edges while building resul...
[occt.git] / tests / bugs / modalg / end
diff --git a/tests/bugs/modalg/end b/tests/bugs/modalg/end
new file mode 100755 (executable)
index 0000000..ce77fef
--- /dev/null
@@ -0,0 +1,62 @@
+if { [isdraw result] } {
+   #check if result is valid
+   
+   puts "checkshape"
+   set ch [checkshape result]
+   puts $ch
+   
+   if { [info exists square] } {
+      set prop "square"
+      set mass $square
+      regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m      
+   }
+   if { [info exists length] } {
+      set prop "length"
+      set mass $length
+      regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m      
+
+      puts "checksection"
+      puts [checksection result]
+   }
+
+   #if mass (length or square) is empty in test case then result should be an empty shape.
+   if { [string compare "$mass" "empty"] != 0 } {
+      if { $m == 0 } {
+                puts "Error : The $command is not valid. The $prop is 0."
+      }
+      if { $mass > 0 } {
+        puts "The expected $prop is $mass"
+      }
+      #check of change of square is < 1%
+      if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
+        puts "Error : The $prop of result shape is $m"
+      }
+      
+      if { [info exists nbsh_v ] } {
+       set arr_v [explode result v]
+       set nb_v [ llength $arr_v ]
+        if { $nb_v != $nbsh_v } {
+           puts "Error : Result shape is WRONG because it must contain $nbsh_v vertexes instead of $nb_v"
+        } else {
+           puts "Result shape contains $nb_v vertexes"
+        }
+        
+      }
+
+      if { [info exists nbsh_e ] } {
+       set arr_e [explode result e]
+       set nb_e [ llength $arr_e ]
+        if { $nb_e != $nbsh_e } {
+           puts "Error : Result shape is WRONG because it must contain $nbsh_e edges instead of $nb_e"
+        } else {
+           puts "Result shape contains $nb_e edges"
+        }
+      }
+   } else {
+      if { $m != 0 } {
+                puts "Error : The $command is not valid. The $prop is $m"
+      }
+   }
+} else {
+   puts "Error : The $command can not be build."
+}