0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / D5
CommitLineData
5a1271c8 1#INTERFACE CAF
2# Basic attributes
3# TDataStd_IntegerArray
4#
5# Testing attribute: User defined (additional GUID) TDataStd_IntegerArray
6#
7# Testing command: SetIntArray
8# Testing command: GetIntArray
9#
10
11puts "caf001-D5"
12set QA_DUP 0
13
14# Add an attribute to a data framework
15set aFrom1 1
16set aTo1 2
17set aSetAttr11 3
18set aSetAttr12 4
19set aLabel 0:2
20set isDelta 0
21set aGuid1 "12e94511-6dbc-11d4-b9c8-0060b0ee281b"
22
23SetIntArray D ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}
24SetIntArray D ${aLabel} ${isDelta} -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# Get a value of the attribute
41set IsGood 1
42set aMessage1 "Add TDataStd_IntegerArray attribute: Error"
43set aGetAttr1 [GetIntArray D ${aLabel}]
44set aLen1 [llength ${aGetAttr1}]
45set aGetAttr2 [GetIntArray D ${aLabel} ${aGuid1}]
46set aLen2 [llength ${aGetAttr2}]
47
48if { ${aLen1} != [expr ${aTo1} - ${aFrom1} + 1] } {
49 set IsGood 0
50 puts "aLen1=${aLen1}"
51 puts ${aMessage1}
52}
53if { ${aLen2} != [expr ${aTo1} - ${aFrom1} + 1] } {
54 set IsGood 0
55 puts "aLen2=${aLen2}"
56 puts ${aMessage1}
57}
58
59set aGetAttr11 [lindex ${aGetAttr1} 0]
60set aGetAttr21 [lindex ${aGetAttr2} 0]
61if { ${aGetAttr11} != ${aGetAttr21} } {
62 set IsGood 0
63 puts "aGetAttr11=${aGetAttr11}"
64 puts "aGetAttr21=${aGetAttr21}"
65 puts ${aMessage1}
66}
67set aGetAttr12 [lindex ${aGetAttr1} 1]
68set aGetAttr22 [lindex ${aGetAttr2} 1]
69if { ${aGetAttr12} != ${aGetAttr22} } {
70 set IsGood 0
71 puts "aGetAttr12=${aGetAttr12}"
72 puts "aGetAttr22=${aGetAttr22}"
73 puts ${aMessage1}
74}
75
76if { ${IsGood} == 0} {
77 puts "Add TDataStd_IntegerArray attribute: Error"
78} else {
79 puts "Add TDataStd_IntegerArray attribute: OK"
80}