0023087: Upgrade of the OCCT test system
[occt.git] / tests / caf / basic / E2
1 #INTERFACE CAF
2 # Basic attributes
3 #
4 # Testing attribute: TDataStd_Name
5 #
6 # Testing command:   SetName
7 # Testing command:   GetName
8 #
9
10 puts "caf001-E2"
11
12 # Add an attribute to a data framework
13 set aSetAttr1 "New Attribute"
14 set aLabel 0:2
15 Label D ${aLabel}
16 SetName D ${aLabel} ${aSetAttr1}
17
18 # Close/Open the transaction
19 NewCommand D
20
21 # Set a new value of the attribute
22 set aSetAttr2 "Old Attribute"
23 SetName D ${aLabel} ${aSetAttr2}
24
25 # Close/Open the transaction
26 NewCommand D
27
28 # Undo
29 Undo D
30
31 # Get a value of the attribute
32 set aGetAttr2 [GetName D ${aLabel}]
33 if { ${aSetAttr1}!=${aGetAttr2} } {
34         puts "aSetAttr1=${aSetAttr1} aGetAttr2=${aGetAttr2}"
35         puts "Set a value of TDataStd_Name attribute: Error"
36         return
37 }
38 puts "Set a value of TDataStd_Name attribute: OK"