0027691: Remove dchrono from all test cases and move its to perf group
[occt.git] / tests / bugs / caf / bug2932_18
CommitLineData
61c421bf 1puts "================"
2puts "OCC2932"
3puts "================"
4puts ""
5#######################################################################################
6# Create Attribute Delta depending on actual change of the attribute
7#######################################################################################
8# Case 16 (TDataStd_Shape)
9#######################################################################################
10
11# Create a new document and set UndoLimit
e837410d 12NewDocument D BinOcaf
61c421bf 13UndoLimit D 100
14
15# Create a label and set attributes
16NewCommand D
17set Label 0:2
18
19############################################
20# Create a box
21set X 10
22set Y 20
23set Z 30
24set DX 100
25set DY 200
26set DZ 300
27box Box ${X} ${Y} ${Z} ${DX} ${DY} ${DZ}
28############################################
29
30set Real1 300.
31set Real2 400.
32set modified_attribute TDataStd_Real
33
34############################################
35# Set TDataStd_Shape
36SetShape D ${Label} Box
37############################################
38
39SetReal D ${Label} ${Real1}
40set list [DumpCommand D]
41
42# Open a transaction
43NewCommand D
44set list [DumpCommand D]
45
46############################################
47# Set old value for TDataStd_Shape
48SetShape D ${Label} Box
49############################################
50
51# Set new value for TDataStd_Real
52SetReal D ${Label} ${Real2}
53set list [DumpCommand D]
54
55# Open a transaction
56NewCommand D
57set list [DumpCommand D]
58
59# Checking
60if { 1 == 2 } {
61set ll [llength ${list}]
62set good_length 17
63puts "length = ${ll}"
64puts "good_length = ${good_length}"
65
66if { ${ll} != ${good_length} } {
67 puts "OCC2932 Error (case 1)"
68} else {
69 set name_attribute [lindex ${list} [expr ${good_length} - 1]]
70 puts "name_attribute = ${name_attribute}"
71 puts "modified_attribute = ${modified_attribute}"
72 if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
73 puts "OCC2932 OK"
74 } else {
75 puts "OCC2932 Error (case 2)"
76 }
77}
78}
79
80# NEW VERSION!!!!!
81set ll [llength ${list}]
82set good_length 20
83puts "length = ${ll}"
84puts "good_length = ${good_length}"
85
86if { ${ll} != ${good_length} } {
87 puts "OCC2932 Error (case 1)"
88} else {
89 set name_attribute1 [lindex ${list} [expr ${good_length} - 1]]
90 set name_attribute2 [lindex ${list} [expr ${good_length} - 4]]
91 set modified_attribute2 TNaming_NamedShape
92 puts "name_attribute1 = ${name_attribute1}"
93 puts "name_attribute2 = ${name_attribute2}"
94 puts "modified_attribute = ${modified_attribute}"
95 puts "modified_attribute2 = ${modified_attribute2}"
96
97 set Is_TDataStd_Real 0
98 set Is_TNaming_NamedShape 0
99 if {[string compare ${name_attribute1} ${modified_attribute}] == 0 ||
100 [string compare ${name_attribute2} ${modified_attribute}] == 0 } {
101 set Is_TDataStd_Real 1
102 }
103 if {[string compare ${name_attribute1} ${modified_attribute2}] == 0 ||
104 [string compare ${name_attribute2} ${modified_attribute2}] == 0 } {
105 set Is_TNaming_NamedShape 1
106 }
107
108
109 if { ${Is_TDataStd_Real} == 1 && ${Is_TNaming_NamedShape} == 1 } {
110 puts "OCC2932 OK"
111 } else {
112 puts "OCC2932 Error (case 2)"
113 }
114
115}