0031918: Application Framework - New binary format for fast reading part of OCAF...
[occt.git] / tests / bugs / caf / bug2932_11
1 puts "================"
2 puts "OCC2932"
3 puts "================"
4 puts ""
5 #######################################################################################
6 # Create Attribute Delta depending on actual change of the attribute 
7 #######################################################################################
8 # Case 9 (TDataStd_Name)
9 #######################################################################################
10
11 # Create a new document and set UndoLimit
12 NewDocument D BinOcaf
13 UndoLimit D 100
14
15 # Create a label and set attributes
16 NewCommand D
17 set Label 0:2
18
19 ############################################
20 set Name "New Name"
21 ############################################
22
23 set Real1 300.
24 set Real2 400.
25 set modified_attribute TDataStd_Real
26
27 ############################################
28 # Set TDataStd_Name
29 Label D ${Label}
30 SetName D ${Label} ${Name}
31 ############################################
32
33 SetReal D ${Label} ${Real1}
34 set list [DumpCommand D]
35
36 # Open a transaction
37 NewCommand D
38 set list [DumpCommand D]
39
40 ############################################
41 # Set old value for TDataStd_Name
42 SetName D ${Label} ${Name}
43 ############################################
44
45 # Set new value for TDataStd_Real
46 SetReal D ${Label} ${Real2}
47 set list [DumpCommand D]
48
49 # Open a transaction
50 NewCommand D
51 set list [DumpCommand D]
52
53 # Checking
54 set ll [llength ${list}]
55 set good_length 17
56 puts "length = ${ll}"
57 puts "good_length = ${good_length}"
58
59 if { ${ll} != ${good_length} } {
60   puts "OCC2932 Error (case 1)"
61 } else {
62   set name_attribute [lindex ${list} [expr ${good_length} - 1]]
63   puts "name_attribute = ${name_attribute}"
64   puts "modified_attribute = ${modified_attribute}"
65   if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
66     puts "OCC2932 OK"
67   } else {
68     puts "OCC2932 Error (case 2)"
69   }
70 }