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