0030773: Application Framework - To allow to inherit existing attributes to reuse...
[occt.git] / tests / caf / basic / E1
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-E1"
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 # Forget the attribute
22 ForgetAll D ${aLabel}
23
24 # Close/Open the transaction
25 NewCommand D
26
27 # Undo-Redo-Undo
28 Undo D
29 Redo D
30 Undo D
31
32 # Get a value of the attribute
33 set aGetAttr1 [GetName D ${aLabel}]
34 if { ${aSetAttr1}!=${aGetAttr1} } {
35         puts "aSetAttr1=${aSetAttr1} aGetAttr1=${aGetAttr1}"
36         puts "Add TDataStd_Name attribute: Error"
37         return
38 }
39 puts "Add TDataStd_Name attribute: OK"