1 #################### select shape and check selection procedure ####################
2 proc Select {lab shape context} {
3 global D IsDone TestError
5 if {[string compare $context ""] == 0} {
6 if {[catch {set res [SelectShape D $lab $shape]}]} {
8 set TestError "$TestError # SelectShape bad result for args: $lab shape"
11 if {[catch {set res [SelectShape D $lab $shape $context]}]} {
13 set TestError "$TestError # SelectShape bad result for args: $lab shape"
16 return [CenterOfShape $shape]
19 if {[catch {set TestLab}] == 1} {
25 source ${scriptdir}/A3
26 set Test "TNaming_Selector test"
28 set TestError " # Can't test iterators becouse of Tool errors: # $TestError"
31 #################### selection and checking shapes ####################
34 set res1 [Select "[set TestLab]:10:1" f ""]
35 set res2 [Select "[set TestLab]:10:2" e1 f]
36 set res3 [Select "[set TestLab]:10:3" e2 ""]
37 ### INTERSECTION NAMING (complex : with GENERATION and IDENTITY)
38 set res4 [Select "[set TestLab]:10:4" v1 "f"]
40 set res5 [Select "[set TestLab]:10:5" b_1 "b"]
43 set res6 [Select "[set TestLab]:10:6" b_1 "b"]
49 for {set i 1} {$i <= 18} {incr i} {
50 set res[expr $i+6] [Select "[set TestLab]:10:[expr $i+6]" c_$i "c"]
54 for {set i 1} {$i <= 8} {incr i} {
55 set res[expr $i+24] [Select "[set TestLab]:10:[expr $i+24]" c_$i "c"]
57 #################### simple GENERATION naming ####################
60 #for {set i 1} {$i <= 3} {incr i} {
61 # set res[expr $i+32] [Select "[set TestLab]:10:[expr $i+32]" p_$i "p"]
64 set res33 [Select "[set TestLab]:10:33" c_1 c]
65 set res34 [Select "[set TestLab]:10:34" c_2 c]
66 ####################### simple MODIFUNTIL naming ####################
67 set res35 [Select "[set TestLab]:10:35" c ""]
69 #################### solve selection checking with empty valid map ####################
70 for {set i 1} {$i <= 35} {incr i} {
71 if {[catch {SolveSelection D [set TestLab]:10:$i}]} {
73 set TestError "$TestError # SolveSelection failed for label [set TestLab]:10:$i"
75 GetShape D [set TestLab]:10:$i r
76 if {[string compare [CenterOfShape r] [set res$i]] != 0} {
78 set TestError "$TestError # SolveSelection result not same for lab $i : [CenterOfShape r] and [set res$i]"
82 #################### with setted valid map ####################
86 puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
88 if {[catch {SolveSelection D [set TestLab]:10:4 [set TestLab]:1:1}] == 0} {
90 set TestError "$TestError # SolveSelection is not failed with deficit of valid map (label [set TestLab]:10:4)"
92 #if {[catch {SolveSelection D [set TestLab]:10:4 [set TestLab]:1:1 [set TestLab]:1:3}] == 1} {
94 # set TestError "$TestError # SolveSelection failed for good valid map (label [set TestLab]:10:4)"