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