File: bug25394_2

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (127 lines) | stat: -rw-r--r-- 3,904 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# =================== OCAF ======================
# Standard attributes of List containers (bin format)
#
# Testing purpose: test of set /get & save / restore 
#                  of TDataStd_BooleanList,  TDataStd_IntegerList 
#                  TDataStd_RealList, TDataStd_ExtStringList,
#                  TDataStd_ReferenceList  attributes
#                  
# ===============================================
# Test case: t2 (testing Set /Get attribute with empty list)
# 1. create BooleanList attribute with empty list
# 2. create IntegerList attribute with empty list
# 3. create RealList attribute with empty list
# 4. create ExtStringList attribute with empty list
# 5. create ReferenceList attribute with empty list
# 6. save the Document in external cbf file 
# 7. reopen the Document
# 8. check the restored attributes at the specified labels
# ===============================================

NewDocument D BinOcaf
# 1.  create BooleanList attribute with empty list
set Lab1 [Label D 0:1:1]
SetBooleanList D $Lab1
set info1 [GetBooleanList D $Lab1]
# output => "List is empty"

# 2. create IntegerList attribute with empty list
set Lab2 [Label D 0:1:2]
SetIntegerList D $Lab2
set info2 [GetIntegerList D $Lab2]
# output => "List is empty"

# 3. create RealList attribute with empty list
set Lab3 [Label D 0:1:3]
SetRealList D $Lab3
set info3 [GetRealList D $Lab3]
# output => "List is empty"

# 4. create ExtStringList attribute with empty list
set Lab4 [Label D 0:1:4]
SetExtStringList D $Lab4
set info4 [GetExtStringList D $Lab4]
# output => "List is empty"

# 5. create ReferenceList attribute with empty list
set Lab5 [Label D 0:1:5]
SetReferenceList D $Lab5
set info5 [GetReferenceList D $Lab5]
# output => "List is empty"

# 6. save the Document in external file
SaveAs D ${imagedir}/bug26014_test2.cbf
Close D

# 7. reopen the Document
Open ${imagedir}/bug26014_test2.cbf D

# 8. Check the restored attributes at the specified labels
set info8 [GetBooleanList D $Lab1]
# output => "List is empty"

set info9 [GetIntegerList D $Lab2]
# output => "List is empty"

set info10 [GetRealList D $Lab3]
# output => "List is empty"

set info11 [GetExtStringList D $Lab4]
# output => "List is empty"

set info12 [GetReferenceList D $Lab5]
# output => "List is empty"

Close D

if { [regexp {List is empty} ${info1}] } {
   puts "OK: created BooleanList attribute is good"
} else {
   puts "Error: created BooleanList attribute is bad"
}
if { [regexp {List is empty} ${info2}] } {
   puts "OK: created IntegerList attribute is good"
} else {
   puts "Error: created IntegerList attribute is bad"
}
if { [regexp {List is empty} ${info3}] } {
   puts "OK: created RealList attribute is good"
} else {
   puts "Error: created RealList attribute is bad"
}
if { [regexp {List is empty} ${info4}] } {
   puts "OK: created ExtStringList attribute is good"
} else {
   puts "Error: created ExtStringList attribute is bad"
}
if { [regexp {List is empty} ${info5}] } {
   puts "OK: created ReferenceList attribute is good"
} else {
   puts "Error: created ReferenceList attribute is bad"
}

if { [regexp {List is empty} ${info8}] } {
   puts "OK: restored BooleanList attribute is good"
} else {
   puts "Error: restored BooleanList attribute is bad"
}
if { [regexp {List is empty} ${info9}] } {
   puts "OK: restored IntegerList attribute is good"
} else {
   puts "Error: restored IntegerList attribute is bad"
}
if { [regexp {List is empty} ${info10}] } {
   puts "OK: restored RealList attribute is good"
} else {
   puts "Error: restored RealList attribute is bad"
}
if { [regexp {List is empty} ${info11}] } {
   puts "OK: restored ExtStringList attribute is good"
} else {
   puts "Error: restored ExtStringList attribute is bad"
}
if { [regexp {List is empty} ${info12}] } {
   puts "OK: restored ReferenceList attribute is good"
} else {
   puts "Error: restored ReferenceList attribute is bad"
}