5a1271c8 |
1 | #INTERFACE CAF |
2 | # Basic attributes |
3 | # TDataStd_RealList |
4 | # |
5 | # Testing attribute: User defined (additional GUID) TDataStd_RealList |
6 | # |
7 | # Testing command: SetRealList |
8 | # Testing command: GetRealList |
9 | # |
10 | |
11 | puts "caf001-R6" |
12 | set QA_DUP 0 |
13 | |
14 | # Add an attributes to a data framework |
15 | set aSetAttr11 3. |
16 | set aSetAttr12 4. |
17 | set aLabel 0:2 |
18 | |
19 | set aGuid1 "12e94521-6dbc-11d4-b9c8-0060b0ee281b" |
20 | |
21 | SetRealList D ${aLabel} ${aSetAttr11} ${aSetAttr12} |
22 | SetRealList 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 | set aFile ${imagedir}/caf001-R6.cbf |
40 | SaveAs D ${aFile}; |
41 | Close D |
42 | |
43 | #Open a document |
44 | Open ${aFile} D |
45 | |
46 | # Get a value of the attribute |
47 | set IsGood 1 |
48 | set aMessage1 "Add TDataStd_RealList attribute: Error" |
49 | set aGetAttr1 [GetRealList D ${aLabel}] |
50 | set aLen1 [llength ${aGetAttr1}] |
51 | set aGetAttr2 [GetRealList D ${aLabel} ${aGuid1}] |
52 | set aLen2 [llength ${aGetAttr2}] |
53 | |
54 | if { ${aLen1} != ${aLen2}} { |
55 | set IsGood 0 |
56 | puts "aLen1=${aLen1}" |
57 | puts "aLen2=${aLen2}" |
58 | puts ${aMessage1} |
59 | } |
60 | |
61 | set aGetAttr11 [lindex ${aGetAttr1} 0] |
62 | set aGetAttr21 [lindex ${aGetAttr2} 0] |
63 | if { ${aGetAttr11} != ${aGetAttr21} } { |
64 | set IsGood 0 |
65 | puts "aGetAttr11=${aGetAttr11}" |
66 | puts "aGetAttr21=${aGetAttr21}" |
67 | puts ${aMessage1} |
68 | } |
69 | set aGetAttr12 [lindex ${aGetAttr1} 1] |
70 | set aGetAttr22 [lindex ${aGetAttr2} 1] |
71 | if { ${aGetAttr12} != ${aGetAttr22} } { |
72 | set IsGood 0 |
73 | puts "aGetAttr12=${aGetAttr12}" |
74 | puts "aGetAttr22=${aGetAttr22}" |
75 | puts ${aMessage1} |
76 | } |
77 | |
78 | if { ${IsGood} == 0} { |
79 | puts "Add TDataStd_RealList attribute: Error" |
80 | } else { |
81 | puts "Add TDataStd_RealList attribute: OK" |
82 | } |