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