1#INTERFACE CAF
2# Basic attributes
3# Std documents
4#
5# Testing support of std format: reading standard attribute  ByteArray
6#
7# Testing command:   Open,  GetByteArray
8#
9
10puts "caf001-W2"
11set QA_DUP 0
12
13# Add an attribute to a data framework
14set aSetAttr1 {12 23 9}
15set aLabel 0:1
16set aFile [locate_data_file caf001_byteAr.std]
17#Open a document
18Open ${aFile} D
19
20# Get a value of the attribute
21set IsGood 1
22set aMessage1 "Add TDataStd_ByteArray attribute: Error"
23set aGetAttr1 [GetByteArray 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_ByteArray attribute: OK"
50}
51