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