1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

78 lines
2.1 KiB
Plaintext
Executable File

if { [isdraw result] } {
#check if result is valid
puts "checkshape"
set ch [checkshape result]
puts $ch
if { [info exists square] } {
set prop "area"
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 the resulting 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 : The resulting shape is WRONG because it must contain $nbsh_v vertexes instead of $nb_v"
} else {
puts "The resulting 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 : The resulting shape is WRONG because it must contain $nbsh_e edges instead of $nb_e"
} else {
puts "The resulting shape contains $nb_e edges"
}
}
} else {
if { $m != 0 } {
puts "Error : The $command is not valid. The $prop is $m"
}
}
smallview
if { $m > 0 } {
donly result
if { [info exists nbsh_v ] } {
explode result v
}
} else {
donly a b
}
fit
xwd $imagedir/${test_image}.png
} else {
puts "Error : The $command cannot be built."
}
# to end a test script
puts "TEST COMPLETED"