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