0028714: XmlMFunction_ScopeDriver fail to read and write function label including...
[occt.git] / tests / bugs / caf / bug2932_22
CommitLineData
61c421bf 1puts "================"
2puts "OCC2932"
3puts "================"
4puts ""
5#######################################################################################
6# Create Attribute Delta depending on actual change of the attribute
7#######################################################################################
8# Case 21 (TFunction_Function)
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# Set a driver guid
21set driverGuid "5b35ca00-5b78-11d1-8940-080009dc3333"
22
23# Set a failure
24set failureNb 13
25############################################
26
27set Real1 300.
28set Real2 400.
29set modified_attribute TDataStd_Real
30
31############################################
32# Set TFunction_Function
33SetFunction D ${Label} ${driverGuid} ${failureNb}
34############################################
35
36SetReal D ${Label} ${Real1}
37set list [DumpCommand D]
38
39# Open a transaction
40NewCommand D
41set list [DumpCommand D]
42
43############################################
44# Set old value for TFunction_Function
45SetFunction D ${Label} ${driverGuid} ${failureNb}
46############################################
47
48# Set new value for TDataStd_Real
49SetReal D ${Label} ${Real2}
50set list [DumpCommand D]
51
52# Open a transaction
53NewCommand D
54set list [DumpCommand D]
55
56# Checking
57set ll [llength ${list}]
58set good_length 17
59puts "length = ${ll}"
60puts "good_length = ${good_length}"
61
62if { ${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}