40093367 |
1 | #INTERFACE CAF |
2 | # Basic attributes |
3 | # |
4 | # Testing attribute: TDataStd_IntegerArray |
5 | # |
6 | # Testing command: SetIntArray |
7 | # Testing command: GetIntArray |
8 | # |
9 | |
10 | puts "caf001-D1" |
11 | set QA_DUP 0 |
12 | |
13 | # Add an attribute to a data framework |
14 | set aFrom1 1 |
15 | set aTo1 2 |
16 | set aSetAttr11 3 |
17 | set aSetAttr12 4 |
18 | set aLabel 0:2 |
19 | set isDelta 0 |
20 | SetIntArray D ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12} |
21 | |
22 | # Close/Open the transaction |
23 | NewCommand D |
24 | |
25 | # Forget the attribute |
26 | ForgetAll D ${aLabel} |
27 | |
28 | # Close/Open the transaction |
29 | NewCommand D |
30 | |
31 | # Undo-Redo-Undo |
32 | Undo D |
33 | Redo D |
34 | Undo D |
35 | |
36 | # Get a value of the attribute |
37 | set IsGood 1 |
38 | set aMessage1 "Add TDataStd_IntegerArray attribute: Error" |
39 | set aGetAttr1 [GetIntArray D ${aLabel}] |
40 | set aLen1 [llength ${aGetAttr1}] |
41 | if { ${aLen1} != [expr ${aTo1} - ${aFrom1} + 1] } { |
42 | set IsGood 0 |
43 | puts "aLen1=${aLen1}" |
44 | puts ${aMessage1} |
45 | ### return |
46 | } |
47 | set aGetAttr21 [lindex ${aGetAttr1} 0] |
48 | if { ${aSetAttr11} != ${aGetAttr21} } { |
49 | set IsGood 0 |
50 | puts "aGetAttr21=${aGetAttr21}" |
51 | puts ${aMessage1} |
52 | ### return |
53 | } |
54 | set aGetAttr22 [lindex ${aGetAttr1} 1] |
55 | if { ${aSetAttr12} != ${aGetAttr22} } { |
56 | set IsGood 0 |
57 | puts "aGetAttr22=${aGetAttr22}" |
58 | puts ${aMessage1} |
59 | ### return |
60 | } |
61 | |
62 | if { ${IsGood} == 0} { |
63 | puts "Add TDataStd_IntegerArray attribute: Error" |
64 | } else { |
65 | puts "Add TDataStd_IntegerArray attribute: OK" |
66 | } |