0027691: Remove dchrono from all test cases and move its to perf group
[occt.git] / tests / bugs / caf / bug2932_19
1 puts "================"
2 puts "OCC2932"
3 puts "================"
4 puts ""
5 #######################################################################################
6 # Create Attribute Delta depending on actual change of the attribute 
7 #######################################################################################
8 # Case 18 (TDataStd_Variable)
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 isConstant
21 set isConstant 1
22
23 # Set a units
24 set units "kg/m3"
25 ############################################
26
27 set Real1 300.
28 set Real2 400.
29 set modified_attribute TDataStd_Real
30
31 ############################################
32 # Set TDataStd_Variable
33 SetVariable D ${Label} ${isConstant} ${units}
34 ############################################
35
36 SetReal D ${Label} ${Real1}
37 set list [DumpCommand D]
38
39 # Open a transaction
40 NewCommand D
41 set list [DumpCommand D]
42
43 ############################################
44 # Set old value for TDataStd_Variable
45 SetVariable D ${Label} ${isConstant} ${units}
46 ############################################
47
48 # Set new value for TDataStd_Real
49 SetReal D ${Label} ${Real2}
50 set list [DumpCommand D]
51
52 # Open a transaction
53 NewCommand D
54 set list [DumpCommand D]
55
56 # Checking
57 set ll [llength ${list}]
58 set good_length 17
59 puts "length = ${ll}"
60 puts "good_length = ${good_length}"
61
62 if { ${ll} != ${good_length} } {
63   puts "OCC2932 Error (case 1)"
64 } else {
65   set name_attribute [lindex ${list} [expr ${good_length} - 1]]
66   puts "name_attribute = ${name_attribute}"
67   puts "modified_attribute = ${modified_attribute}"
68   if {[string compare ${name_attribute} ${modified_attribute}] == 0} {
69     puts "OCC2932 OK"
70   } else {
71     puts "OCC2932 Error (case 2)"
72   }
73 }