0030773: Application Framework - To allow to inherit existing attributes to reuse...
[occt.git] / tests / caf / basic / V7
CommitLineData
5a1271c8 1#INTERFACE CAF
2# Basic attributes
3# TDataStd_ReferenceList
4#
5# Testing attribute: User defined (additional GUID) TDataStd_ReferenceList
6#
7# Testing command: SetReferenceList
8# Testing command: GetReferenceList
9#
10
11puts "caf001-V7"
12set QA_DUP 0
13
14# Add an attribute to a data framework
15set aSetAttr11 0:3
16set aSetAttr12 0:4
17set aLabel 0:2
18
19set aGuid1 "12e94561-6dbc-11d4-b9c8-0060b0ee281b"
20
21SetReferenceList D ${aLabel} ${aSetAttr11} ${aSetAttr12}
22SetReferenceList D ${aLabel} -g ${aGuid1} ${aSetAttr11} ${aSetAttr12}
23
24# Close/Open the transaction
25NewCommand D
26
27# Forget the attribute
28ForgetAll D ${aLabel}
29
30# Close/Open the transaction
31NewCommand D
32
33# Undo-Redo-Undo
34Undo D
35Redo D
36Undo D
37
38# Save Document
39Format D XmlOcaf
40set aFile ${imagedir}/caf001-V7.xml
41SaveAs D ${aFile}
42Close D
43
44#Open a document
45Open ${aFile} D
46
47
48# Get a value of the attribute
49set IsGood 1
50set aMessage1 "Add TDataStd_ReferenceList attribute: Error"
51set aGetAttr1 [GetReferenceList D ${aLabel}]
52set aLen1 [llength ${aGetAttr1}]
53set aGetAttr2 [GetReferenceList D ${aLabel} ${aGuid1}]
54set aLen2 [llength ${aGetAttr2}]
55
56if { ${aLen1} != ${aLen2}} {
57 set IsGood 0
58 puts "aLen1=${aLen1}"
59 puts "aLen2=${aLen2}"
60 puts ${aMessage1}
61}
62
63set aGetAttr11 [lindex ${aGetAttr1} 0]
64set aGetAttr21 [lindex ${aGetAttr2} 0]
65if { ${aGetAttr11} != ${aGetAttr21} } {
66 set IsGood 0
67 puts "aGetAttr11=${aGetAttr11}"
68 puts "aGetAttr21=${aGetAttr21}"
69 puts ${aMessage1}
70}
71set aGetAttr12 [lindex ${aGetAttr1} 1]
72set aGetAttr22 [lindex ${aGetAttr2} 1]
73if { ${aGetAttr12} != ${aGetAttr22} } {
74 set IsGood 0
75 puts "aGetAttr12=${aGetAttr12}"
76 puts "aGetAttr22=${aGetAttr22}"
77 puts ${aMessage1}
78}
79
80if { ${IsGood} == 0} {
81 puts "Add TDataStd_ReferenceList attribute: Error"
82} else {
83 puts "Add TDataStd_ReferenceList attribute: OK"
84}