0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / W11
CommitLineData
5a1271c8 1#INTERFACE CAF
2# Basic attributes
3# Std documents
4#
5# Testing support of std format: reading standard attribute ReferenceList
6#
7# Testing command: Open, GetReferenceList.
8#
9
10puts "caf001-W11"
11set QA_DUP 0
12
13# Add an attribute to a data framework
14set aSetAttr1 {0:1:5 0:1:3 0:1:2 0:1:1 0:1:4}
15set aLabel 0:1
16set aFile [locate_data_file caf001_refList.std]
17#Open a document
18Open ${aFile} D
19
20# Get a value of the attribute
21set IsGood 1
22set aMessage1 "Add TDataStd_ReferenceList attribute: Error"
23set aGetAttr1 [GetReferenceList D ${aLabel}]
24set aLenRead [llength ${aGetAttr1}]
25set aLenSet [llength ${aSetAttr1}]
26
27if { ${aLenRead} != ${aLenSet} } {
28 set IsGood 0
29 puts "aLenRead=${aLenRead}"
30 puts ${aMessage1}
31}
32
33if { ${IsGood} == 0} return
34
35for {set i 0} {$i < $aLenRead} {incr i} {
36 set aGetAttr11 [lindex ${aGetAttr1} $i]
37 set aGetAttr21 [lindex ${aSetAttr1} $i]
38 if { ${aGetAttr11} != ${aGetAttr21} } {
39 set IsGood 0;puts "i=${i}"
40 puts "aGetAttr11=${aGetAttr11}"
41 puts "aGetAttr21=${aGetAttr21}"
42 break
43 }
44}
45
46if { ${IsGood} == 0} {
47 puts ${aMessage1}
48} else {
49 puts "Add TDataStd_ReferenceList attribute: OK"
50}