0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / O7
CommitLineData
5a1271c8 1#INTERFACE CAF
2# Basic attributes
3# TDataStd_BooleanArray
4#
5# Testing attribute: User defined (additional GUID) TDataStd_BooleanArray
6#
7# Testing command: SetBooleanArray
8# Testing command: GetBooleanArray
9#
10
11puts "caf001-O7"
12set QA_DUP 0
13
14# Add an attribute to a data framework
15set aFrom1 1
16set aTo1 2
17set aSetAttr11 0
18set aSetAttr12 1
19set aLabel 0:2
20
21set aGuid1 "12e94516-6dbc-11d4-b9c8-0060b0ee281b"
22
23SetBooleanArray D ${aLabel} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}
24SetBooleanArray D ${aLabel} -g ${aGuid1} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}
25
26# Close/Open the transaction
27NewCommand D
28
29# Forget the attribute
30ForgetAll D ${aLabel}
31
32# Close/Open the transaction
33NewCommand D
34
35# Undo-Redo-Undo
36Undo D
37Redo D
38Undo D
39
40# Save Document
41Format D XmlOcaf
42set aFile ${imagedir}/caf001-O7.xml
43SaveAs D ${aFile}
44Close D
45
46#Open a document
47Open ${aFile} D
48
49
50# Get a value of the attribute
51set IsGood 1
52set aMessage1 "Add TDataStd_BooleanArray attribute: Error"
53set aGetAttr1 [GetBooleanArray D ${aLabel}]
54set aLen1 [llength ${aGetAttr1}]
55set aGetAttr2 [GetBooleanArray D ${aLabel} ${aGuid1}]
56set aLen2 [llength ${aGetAttr2}]
57
58if { ${aLen1} != [expr ${aTo1} - ${aFrom1} + 1] } {
59 set IsGood 0
60 puts "aLen1=${aLen1}"
61 puts ${aMessage1}
62}
63if { ${aLen2} != [expr ${aTo1} - ${aFrom1} + 1] } {
64 set IsGood 0
65 puts "aLen2=${aLen2}"
66 puts ${aMessage1}
67}
68
69set aGetAttr11 [lindex ${aGetAttr1} 0]
70set aGetAttr21 [lindex ${aGetAttr2} 0]
71if { ${aGetAttr11} != ${aGetAttr21} } {
72 set IsGood 0
73 puts "aGetAttr11=${aGetAttr11}"
74 puts "aGetAttr21=${aGetAttr21}"
75 puts ${aMessage1}
76}
77set aGetAttr12 [lindex ${aGetAttr1} 1]
78set aGetAttr22 [lindex ${aGetAttr2} 1]
79if { ${aGetAttr12} != ${aGetAttr22} } {
80 set IsGood 0
81 puts "aGetAttr12=${aGetAttr12}"
82 puts "aGetAttr22=${aGetAttr22}"
83 puts ${aMessage1}
84}
85
86if { ${IsGood} == 0} {
87 puts "Add TDataStd_BooleanArray attribute: Error"
88} else {
89 puts "Add TDataStd_BooleanArray attribute: OK"
90}