Adding test cases from chl grid
[occt.git] / tests / bugs / xde / bug1669
1 puts "================"
2 puts "OCC1669"
3 puts "================"
4 puts ""
5 #################################################################
6 # Wrong name mapping of the instances of assembly into STEP file.
7 #################################################################
8
9 set BugNumber OCC1669
10
11 catch {pload DCAF}
12
13 XNewDoc SA
14
15 box b1 10 10 10
16 box b2 20 10 10
17 ttranslate b1 10 0 0
18 ttranslate b2 20 0 0
19 compound b1 b2 bl
20 copy bl nbl
21 ttranslate nbl 30 0 0
22 compound bl nbl ryad
23 copy ryad hryad
24 ttranslate hryad -10 0 10
25 copy ryad uryad
26 ttranslate uryad 0 0 20
27 compound ryad hryad uryad stena
28
29 XAddShape SA stena 1
30
31 SetName SA 0:1:1:1 Wall
32 SetName SA 0:1:1:2 Block-Array
33 SetName SA 0:1:1:3 Block
34 SetName SA 0:1:1:4 Half-Brick
35 SetName SA 0:1:1:5 Brick
36
37 SetName SA 0:1:1:1:1 base-array
38 SetName SA 0:1:1:1:2 next-array
39 SetName SA 0:1:1:1:3 top-array
40
41 SetName SA 0:1:1:2:1 left-block
42 SetName SA 0:1:1:2:2 right-block
43
44 SetName SA 0:1:1:3:1 half-brick
45 SetName SA 0:1:1:3:2 brick
46
47 catch { WriteStep SA $imagedir/${test_image}.stp }
48 catch { ReadStep D $imagedir/${test_image}.stp }
49
50 puts "Info: Now compare two documents SA and D"
51 #DFBrowse SA
52 #DFBrowse D
53
54 set NamesList1 {Wall Block-Array Block Half-Brick Brick}
55 set NamesList2 {base-array next-array top-array}
56 set NamesList3 {left-block right-block}
57 set NamesList4 {half-brick brick}
58
59 set status 0
60
61 for {set i 1} {$i <= 5} {incr i} {
62     set name [ GetName D 0:1:1:$i ]
63     set ref_name [lindex $NamesList1 $i-1]
64     if { $name != $ref_name } {
65        set status 1
66        break
67     }
68 }
69
70 if { $status != 1 } {
71    for {set i 1} {$i <= 3} {incr i} {
72         set name [ GetName D 0:1:1:1:$i ]
73         set ref_name [lindex $NamesList2 $i-1]
74         if { $name != $ref_name } {
75            set status 1
76            break
77         }
78    }
79 }
80
81 if { $status != 1 } {
82    for {set i 1} {$i <= 2} {incr i} {
83         set name [ GetName D 0:1:1:2:$i ]
84         set ref_name [lindex $NamesList3 $i-1]
85         if { $name != $ref_name } {
86            set status 1
87            break
88         }
89    }
90 }
91
92 if { $status != 1 } {
93    for {set i 1} {$i <= 2} {incr i} {
94         set name [ GetName D 0:1:1:3:$i ]
95         set ref_name [lindex $NamesList4 $i-1]
96         if { $name != $ref_name } {
97            set status 1
98            break
99         }
100    }
101 }
102
103 if { $status != 0 }  {
104   puts "Faulty ${BugNumber}"
105 } else {
106   puts "OK ${BugNumber}"
107 }