0014531: Boolean Operation Algorithm fails
[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
53SaveAs D ${imagedir}/bug26014_test2.cbf
54Close D
55
56# 7. reopen the Document
57Open ${imagedir}/bug26014_test2.cbf D
58
59# 8. Check the restored attributes at the specified labels
60set info8 [GetBooleanList D $Lab1]
61# output => "List is empty"
62
63set info9 [GetIntegerList D $Lab2]
64# output => "List is empty"
65
66set info10 [GetRealList D $Lab3]
67# output => "List is empty"
68
69set info11 [GetExtStringList D $Lab4]
70# output => "List is empty"
71
72set info12 [GetReferenceList D $Lab5]
73# output => "List is empty"
74
75Close D
76
77if { [regexp {List is empty} ${info1}] } {
78 puts "OK: created BooleanList attribute is good"
79} else {
80 puts "Error: created BooleanList attribute is bad"
81}
82if { [regexp {List is empty} ${info2}] } {
83 puts "OK: created IntegerList attribute is good"
84} else {
85 puts "Error: created IntegerList attribute is bad"
86}
87if { [regexp {List is empty} ${info3}] } {
88 puts "OK: created RealList attribute is good"
89} else {
90 puts "Error: created RealList attribute is bad"
91}
92if { [regexp {List is empty} ${info4}] } {
93 puts "OK: created ExtStringList attribute is good"
94} else {
95 puts "Error: created ExtStringList attribute is bad"
96}
97if { [regexp {List is empty} ${info5}] } {
98 puts "OK: created ReferenceList attribute is good"
99} else {
100 puts "Error: created ReferenceList attribute is bad"
101}
102
103if { [regexp {List is empty} ${info8}] } {
104 puts "OK: restored BooleanList attribute is good"
105} else {
106 puts "Error: restored BooleanList attribute is bad"
107}
108if { [regexp {List is empty} ${info9}] } {
109 puts "OK: restored IntegerList attribute is good"
110} else {
111 puts "Error: restored IntegerList attribute is bad"
112}
113if { [regexp {List is empty} ${info10}] } {
114 puts "OK: restored RealList attribute is good"
115} else {
116 puts "Error: restored RealList attribute is bad"
117}
118if { [regexp {List is empty} ${info11}] } {
119 puts "OK: restored ExtStringList attribute is good"
120} else {
121 puts "Error: restored ExtStringList attribute is bad"
122}
123if { [regexp {List is empty} ${info12}] } {
124 puts "OK: restored ReferenceList attribute is good"
125} else {
126 puts "Error: restored ReferenceList attribute is bad"
127}