0032705: Test - name clashes within temporary files within bugs/caf/bug23766_X
[occt.git] / tests / bugs / caf / bug25394_2
CommitLineData
d585e74e 1# =================== OCAF ======================
2# Standard attributes of List containers (bin format)
3#
4# Testing purpose: test of set /get & save / restore
5# of TDataStd_BooleanList, TDataStd_IntegerList
6# TDataStd_RealList, TDataStd_ExtStringList,
7# TDataStd_ReferenceList attributes
8#
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# ===============================================
20
21NewDocument D BinOcaf
22# 1. create BooleanList attribute with empty list
23set Lab1 [Label D 0:1:1]
24SetBooleanList D $Lab1
25set info1 [GetBooleanList D $Lab1]
26# output => "List is empty"
27
28# 2. create IntegerList attribute with empty list
29set Lab2 [Label D 0:1:2]
30SetIntegerList D $Lab2
31set info2 [GetIntegerList D $Lab2]
32# output => "List is empty"
33
34# 3. create RealList attribute with empty list
35set Lab3 [Label D 0:1:3]
36SetRealList D $Lab3
37set info3 [GetRealList D $Lab3]
38# output => "List is empty"
39
40# 4. create ExtStringList attribute with empty list
41set Lab4 [Label D 0:1:4]
42SetExtStringList D $Lab4
43set info4 [GetExtStringList D $Lab4]
44# output => "List is empty"
45
46# 5. create ReferenceList attribute with empty list
47set Lab5 [Label D 0:1:5]
48SetReferenceList D $Lab5
49set info5 [GetReferenceList D $Lab5]
50# output => "List is empty"
51
52# 6. save the Document in external file
30fa5f67 53set aTmpFile ${imagedir}/${casename}.cbf
54SaveAs D $aTmpFile
d585e74e 55Close D
56
57# 7. reopen the Document
30fa5f67 58Open $aTmpFile D
59file delete -force $aTmpFile
d585e74e 60
61# 8. Check the restored attributes at the specified labels
62set info8 [GetBooleanList D $Lab1]
63# output => "List is empty"
64
65set info9 [GetIntegerList D $Lab2]
66# output => "List is empty"
67
68set info10 [GetRealList D $Lab3]
69# output => "List is empty"
70
71set info11 [GetExtStringList D $Lab4]
72# output => "List is empty"
73
74set info12 [GetReferenceList D $Lab5]
75# output => "List is empty"
76
77Close D
78
79if { [regexp {List is empty} ${info1}] } {
80 puts "OK: created BooleanList attribute is good"
81} else {
82 puts "Error: created BooleanList attribute is bad"
83}
84if { [regexp {List is empty} ${info2}] } {
85 puts "OK: created IntegerList attribute is good"
86} else {
87 puts "Error: created IntegerList attribute is bad"
88}
89if { [regexp {List is empty} ${info3}] } {
90 puts "OK: created RealList attribute is good"
91} else {
92 puts "Error: created RealList attribute is bad"
93}
94if { [regexp {List is empty} ${info4}] } {
95 puts "OK: created ExtStringList attribute is good"
96} else {
97 puts "Error: created ExtStringList attribute is bad"
98}
99if { [regexp {List is empty} ${info5}] } {
100 puts "OK: created ReferenceList attribute is good"
101} else {
102 puts "Error: created ReferenceList attribute is bad"
103}
104
105if { [regexp {List is empty} ${info8}] } {
106 puts "OK: restored BooleanList attribute is good"
107} else {
108 puts "Error: restored BooleanList attribute is bad"
109}
110if { [regexp {List is empty} ${info9}] } {
111 puts "OK: restored IntegerList attribute is good"
112} else {
113 puts "Error: restored IntegerList attribute is bad"
114}
115if { [regexp {List is empty} ${info10}] } {
116 puts "OK: restored RealList attribute is good"
117} else {
118 puts "Error: restored RealList attribute is bad"
119}
120if { [regexp {List is empty} ${info11}] } {
121 puts "OK: restored ExtStringList attribute is good"
122} else {
123 puts "Error: restored ExtStringList attribute is bad"
124}
125if { [regexp {List is empty} ${info12}] } {
126 puts "OK: restored ReferenceList attribute is good"
127} else {
128 puts "Error: restored ReferenceList attribute is bad"
129}