0026342: No materials are read from STEP
[occt.git] / tests / bugs / caf / bug2932_7
CommitLineData
61c421bf 1puts "================"
2puts "OCC2932"
3puts "================"
4puts ""
5#######################################################################################
6# Create Attribute Delta depending on actual change of the attribute
7#######################################################################################
8# Case 5 (TDataStd_Expression)
9#######################################################################################
10
11pload QAcommands
12
13# Create a new document and set UndoLimit
e837410d 14NewDocument D BinOcaf
61c421bf 15UndoLimit D 100
16
17# Create a label and set attributes
18NewCommand D
19set Label 0:2
20
21############################################
22set Expression "New Expression"
23############################################
24
25set Real1 300.
26set Real2 400.
27set modified_attribute TDataStd_Real
28
29############################################
30OCC2932_SetExpression D ${Label} ${Expression}
31############################################
32
33SetReal D ${Label} ${Real1}
34set list [DumpCommand D]
35
36# Open a transaction
37NewCommand D
38set list [DumpCommand D]
39
40############################################
41# Set old value for TDataStd_Expression
42OCC2932_SetExpression D ${Label} ${Expression}
43############################################
44
45# Set new value for TDataStd_Real
46SetReal D ${Label} ${Real2}
47set list [DumpCommand D]
48
49# Open a transaction
50NewCommand D
51set list [DumpCommand D]
52
53# Checking
54set ll [llength ${list}]
55set good_length 17
56puts "length = ${ll}"
57puts "good_length = ${good_length}"
58
59if { ${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}