0023087: Upgrade of the OCCT test system
[occt.git] / tests / caf / basic / C2
CommitLineData
40093367 1#INTERFACE CAF
2# Basic attributes
3#
4# Testing attribute: TDataStd_RealArray
5#
6# Testing command: SetRealArray
7# Testing command: GetRealArray
8#
9
10puts "caf001-C2"
11set QA_DUP 0
12
13# Add an attribute to a data framework
14set aFrom1 1
15set aTo1 2
16set aSetAttr11 3.
17set aSetAttr12 4.
18set aLabel 0:2
19set isDelta 0
20SetRealArray D ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}
21
22# Close/Open the transaction
23NewCommand D
24
25# Set a new value of the attribute
26set aFrom2 1
27set aTo2 2
28set aSetAttr21 33.
29set aSetAttr22 44.
30SetRealArray D ${aLabel} ${isDelta} ${aFrom2} ${aTo2} ${aSetAttr21} ${aSetAttr22}
31
32# Close/Open the transaction
33NewCommand D
34
35# Undo
36Undo D
37
38# Get a value of the attribute
39set IsGood 1
40set aMessage2 "Set a value of TDataStd_RealArray attribute: Error"
41set aGetAttr2 [GetRealArray D ${aLabel}]
42set aLen2 [llength ${aGetAttr2}]
43if { ${aLen2} != [expr ${aTo1} - ${aFrom1} + 1] } {
44 set IsGood 0
45 puts "aLen2=${aLen2}"
46 puts ${aMessage2}
47### return
48}
49set aGetAttr31 [lindex ${aGetAttr2} 0]
50if { ${aSetAttr11} != ${aGetAttr31} } {
51 set IsGood 0
52 puts "aGetAttr31=${aGetAttr31}"
53 puts ${aMessage2}
54### return
55}
56set aGetAttr32 [lindex ${aGetAttr2} 1]
57if { ${aSetAttr12} != ${aGetAttr32} } {
58 set IsGood 0
59 puts "aGetAttr32=${aGetAttr32}"
60 puts ${aMessage2}
61### return
62}
63
64if { ${IsGood} == 0} {
65 puts "Set a value of TDataStd_RealArray attribute: Error"
66} else {
67 puts "Set a value of TDataStd_RealArray attribute: OK"
68}