Adjusting bugs group for current state of OCCT
[occt.git] / tests / bugs / caf / bug2932_12
1 puts "================"
2 puts "OCC2932"
3 puts "================"
4 puts ""
5 #######################################################################################
6 # Create Attribute Delta depending on actual change of the attribute 
7 #######################################################################################
8 # Case 10 (TDataStd_PatternStd)
9 #######################################################################################
10
11 # Create a new document and set UndoLimit
12 NewDocument D MDTV-Standard
13 UndoLimit D 100
14
15 # Create a label and set attributes
16 NewCommand D
17 set Label 0:2
18
19 ############################################
20 # Create a box
21 set X 10
22 set Y 20
23 set Z 30
24 set DX 100
25 set DY 200
26 set DZ 300
27 box Box ${X} ${Y} ${Z} ${DX} ${DY} ${DZ}
28
29 # Set a shape to the label
30 set BoxLabel 0:3
31 SetShape D ${BoxLabel} Box
32
33 # Set a real attribute
34 set RealLabel 0:4
35 set RealPattern 123.456789
36 SetReal D ${RealLabel} ${RealPattern}
37
38 # Set an integer attribute
39 set IntegerLabel 0:5
40 set IntegerPattern 123456789
41 SetInteger D ${IntegerLabel} ${IntegerPattern}
42
43 # Set a signature
44 set signature 1
45 ############################################
46
47 set Real1 300.
48 set Real2 400.
49 set modified_attribute TDataStd_Real
50
51 ############################################
52 # Set TDataStd_PatternStd
53 Label D ${Label}
54 SetPattern D ${Label} ${signature} ${BoxLabel} ${RealLabel} ${IntegerLabel}
55 ############################################
56
57 SetReal D ${Label} ${Real1}
58 set list [DumpCommand D]
59
60 # Open a transaction
61 NewCommand D
62 set list [DumpCommand D]
63
64 ############################################
65 # Set old value for TDataStd_PatternStd
66 SetPattern D ${Label} ${signature} ${BoxLabel} ${RealLabel} ${IntegerLabel}
67 ############################################
68
69 # Set new value for TDataStd_Real
70 SetReal D ${Label} ${Real2}
71 set list [DumpCommand D]
72
73 # Open a transaction
74 NewCommand D
75 set list [DumpCommand D]
76
77 # Checking
78 set ll [llength ${list}]
79 set good_length 17
80 puts "length = ${ll}"
81 puts "good_length = ${good_length}"
82
83 if { ${ll} != ${good_length} } {
84   puts "OCC2932 Error (case 1)"
85 } else {
86   set name_attribute [lindex ${list} [expr ${good_length} - 1]]
87   puts "name_attribute = ${name_attribute}"
88   puts "modified_attribute = ${modified_attribute}"
89   if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
90     puts "OCC2932 OK"
91   } else {
92     puts "OCC2932 Error (case 2)"
93   }
94 }