0027691: Remove dchrono from all test cases and move its to perf group
[occt.git] / tests / bugs / caf / bug23465
CommitLineData
1ff07227 1# =================== OCAF ======================
2# Standard attributes of List containers (xml format)
3#
4# Testing purpose: test of InsertBefore / InsertAfter / Remove
5# of TDataStd_BooleanList, TDataStd_IntegerList
6# TDataStd_RealList, TDataStd_ExtStringList,
7# TDataStd_ReferenceList attributes
8#
9# ===============================================
10# Test case:
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. insert before a value
17# 7. insert after a value
18# 8. remove a value
19# 9. check the values
20# ===============================================
21
22NewDocument D XmlOcaf
23# 1. create BooleanList attribute
24set Lab1 [Label D 0:1:1]
25SetBooleanList D $Lab1 0 0 1 0
26set info1 [GetBooleanList D $Lab1]
27# output => "0 0 1 0"
28
29# 2. create IntegerList attribute
30set Lab2 [Label D 0:1:2]
31SetIntegerList D $Lab2 0 0 1 0
32set info2 [GetIntegerList D $Lab2]
33# output => "0 0 1 0"
34
35# 3. create RealList attribute
36set Lab3 [Label D 0:1:3]
37SetRealList D $Lab3 0 0 1 0
38set info3 [GetRealList D $Lab3]
39# output => "0 0 1 0"
40
41# 4. create ExtStringList attribute
42set Lab4 [Label D 0:1:4]
43SetExtStringList D $Lab4 0 0 1 0
44set info4 [GetExtStringList D $Lab4]
45# output => "0 0 1 0"
46
47# 5. create ReferenceList attribute
48set Lab5 [Label D 0:1:5]
49SetReferenceList D $Lab5 $Lab1 $Lab2 $Lab4
50set info5 [GetReferenceList D $Lab5]
51# output => "0:1:1 0:1:2 0:1:4"
52
53# 6. insert before a value
54InsertBeforeBooleanList D $Lab1 3 1
55InsertBeforeIntegerList D $Lab2 3 1
56InsertBeforeRealList D $Lab3 3 1
57InsertBeforeExtStringList D $Lab4 3 1
58InsertBeforeReferenceList D $Lab5 3 0:1:3
59# output => "0 0 1 1 0"
60# output => "0:1:1 0:1:2 0:1:3 0:1:4"
61
62# 7. insert after a value
63InsertAfterBooleanList D $Lab1 4 1
64InsertAfterIntegerList D $Lab2 4 1
65InsertAfterRealList D $Lab3 4 1
66InsertAfterExtStringList D $Lab4 4 1
67InsertAfterReferenceList D $Lab5 4 0:1:5
68# output => "0 0 1 1 1 0"
69# output => "0:1:1 0:1:2 0:1:3 0:1:4 0:1:5"
70
71# 8. remove a value
72RemoveBooleanList D $Lab1 6
73RemoveIntegerList D $Lab2 6
74RemoveRealList D $Lab3 6
75RemoveExtStringList D $Lab4 6
76RemoveReferenceList D $Lab5 1
77# output => "0 0 1 1 1"
78# output => "0:1:2 0:1:3 0:1:4 0:1:5"
79
80# 8. Check the values
81set info6 [GetBooleanList D $Lab1]
82set info7 [GetIntegerList D $Lab2]
83set info8 [GetRealList D $Lab3]
84set info9 [GetExtStringList D $Lab4]
85set info10 [GetReferenceList D $Lab5]
86# output => "0 0 1 1 1"
87# output => "0:1:2 0:1:3 0:1:4 0:1:5"
88
89Close D
90
91if { [regexp {0 0 1 1 1} ${info6}] } {
92 puts "OK: inserted and removed values for BooleanList attribute are good"
93} else {
94 puts "Error: inserted and removed values for BooleanList attribute are bad"
95}
96
97if { [regexp {0 0 1 1 1} ${info7}] } {
98 puts "OK: inserted and removed values for IntegerList attribute are good"
99} else {
100 puts "Error: inserted and removed values for IntegerList attribute are bad"
101}
102
103if { [regexp {0 0 1 1 1} ${info8}] } {
104 puts "OK: inserted and removed values for RealList attribute are good"
105} else {
106 puts "Error: inserted and removed values for RealList attribute are bad"
107}
108
109if { [regexp {0 0 1 1 1} ${info9}] } {
110 puts "OK: inserted and removed values for ExtStringList attribute are good"
111} else {
112 puts "Error: inserted and removed values for ExtStringList attribute are bad"
113}
114
115if { [regexp {0:1:2 0:1:3 0:1:4 0:1:5} ${info10}] } {
116 puts "OK: inserted and removed values for ReferenceList attribute are good"
117} else {
118 puts "Error: inserted and removed values for ReferenceList attribute are bad"
119}