1 # =================== OCAF ======================
2 # Standard attributes of List containers (bin format)
4 # Testing purpose: test of set /get & save / restore
5 # of TDataStd_BooleanList, TDataStd_IntegerList
6 # TDataStd_RealList, TDataStd_ExtStringList,
7 # TDataStd_ReferenceList attributes
9 # ===============================================
10 # Test case: t2 (testing Set /Get attribute with empty list)
11 # 1. create BooleanList attribute with empty list
12 # 2. create IntegerList attribute with empty list
13 # 3. create RealList attribute with empty list
14 # 4. create ExtStringList attribute with empty list
15 # 5. create ReferenceList attribute with empty list
16 # 6. save the Document in external cbf file
17 # 7. reopen the Document
18 # 8. check the restored attributes at the specified labels
19 # ===============================================
22 # 1. create BooleanList attribute with empty list
23 set Lab1 [Label D 0:1:1]
24 SetBooleanList D $Lab1
25 set info1 [GetBooleanList D $Lab1]
26 # output => "List is empty"
28 # 2. create IntegerList attribute with empty list
29 set Lab2 [Label D 0:1:2]
30 SetIntegerList D $Lab2
31 set info2 [GetIntegerList D $Lab2]
32 # output => "List is empty"
34 # 3. create RealList attribute with empty list
35 set Lab3 [Label D 0:1:3]
37 set info3 [GetRealList D $Lab3]
38 # output => "List is empty"
40 # 4. create ExtStringList attribute with empty list
41 set Lab4 [Label D 0:1:4]
42 SetExtStringList D $Lab4
43 set info4 [GetExtStringList D $Lab4]
44 # output => "List is empty"
46 # 5. create ReferenceList attribute with empty list
47 set Lab5 [Label D 0:1:5]
48 SetReferenceList D $Lab5
49 set info5 [GetReferenceList D $Lab5]
50 # output => "List is empty"
52 # 6. save the Document in external file
53 SaveAs D ${imagedir}/bug26014_test2.cbf
56 # 7. reopen the Document
57 Open ${imagedir}/bug26014_test2.cbf D
59 # 8. Check the restored attributes at the specified labels
60 set info8 [GetBooleanList D $Lab1]
61 # output => "List is empty"
63 set info9 [GetIntegerList D $Lab2]
64 # output => "List is empty"
66 set info10 [GetRealList D $Lab3]
67 # output => "List is empty"
69 set info11 [GetExtStringList D $Lab4]
70 # output => "List is empty"
72 set info12 [GetReferenceList D $Lab5]
73 # output => "List is empty"
77 if { [regexp {List is empty} ${info1}] } {
78 puts "OK: created BooleanList attribute is good"
80 puts "Error: created BooleanList attribute is bad"
82 if { [regexp {List is empty} ${info2}] } {
83 puts "OK: created IntegerList attribute is good"
85 puts "Error: created IntegerList attribute is bad"
87 if { [regexp {List is empty} ${info3}] } {
88 puts "OK: created RealList attribute is good"
90 puts "Error: created RealList attribute is bad"
92 if { [regexp {List is empty} ${info4}] } {
93 puts "OK: created ExtStringList attribute is good"
95 puts "Error: created ExtStringList attribute is bad"
97 if { [regexp {List is empty} ${info5}] } {
98 puts "OK: created ReferenceList attribute is good"
100 puts "Error: created ReferenceList attribute is bad"
103 if { [regexp {List is empty} ${info8}] } {
104 puts "OK: restored BooleanList attribute is good"
106 puts "Error: restored BooleanList attribute is bad"
108 if { [regexp {List is empty} ${info9}] } {
109 puts "OK: restored IntegerList attribute is good"
111 puts "Error: restored IntegerList attribute is bad"
113 if { [regexp {List is empty} ${info10}] } {
114 puts "OK: restored RealList attribute is good"
116 puts "Error: restored RealList attribute is bad"
118 if { [regexp {List is empty} ${info11}] } {
119 puts "OK: restored ExtStringList attribute is good"
121 puts "Error: restored ExtStringList attribute is bad"
123 if { [regexp {List is empty} ${info12}] } {
124 puts "OK: restored ReferenceList attribute is good"
126 puts "Error: restored ReferenceList attribute is bad"