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