0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / S5
1 #INTERFACE CAF
2 # Basic attributes
3 # TDataStd_IntegerList
4 #
5 # Testing attribute: User defined (additional GUID) TDataStd_IntegerList
6 #
7 # Testing command:   SetIntegerList
8 # Testing command:   GetIntegerList
9 #
10
11 puts "caf001-S5"
12 set QA_DUP 0
13
14 # Add an attribute to a data framework
15 set aSetAttr11 33
16 set aSetAttr12 44
17 set aLabel 0:2
18
19 set aGuid1 "12e94531-6dbc-11d4-b9c8-0060b0ee281b"
20
21 SetIntegerList D ${aLabel} ${aSetAttr11} ${aSetAttr12}
22 SetIntegerList D ${aLabel} -g ${aGuid1} ${aSetAttr11} ${aSetAttr12}
23
24 # Close/Open the transaction
25 NewCommand D
26
27 # Forget the attribute
28 ForgetAll D ${aLabel}
29
30 # Close/Open the transaction
31 NewCommand D
32
33 # Undo-Redo-Undo
34 Undo D
35 Redo D
36 Undo D
37
38 # Get a value of the attribute
39 set IsGood 1
40 set aMessage1 "Add TDataStd_IntegerList attribute: Error"
41 set aGetAttr1 [GetIntegerList D ${aLabel}]
42 set aLen1 [llength ${aGetAttr1}]
43 set aGetAttr2 [GetIntegerList D ${aLabel} ${aGuid1}]
44 set aLen2 [llength ${aGetAttr2}]
45
46 if { ${aLen1} != ${aLen2}} {
47     set IsGood 0
48     puts "aLen1=${aLen1}"
49     puts "aLen2=${aLen2}"
50     puts ${aMessage1}
51 }
52
53 set aGetAttr11 [lindex ${aGetAttr1} 0]
54 set aGetAttr21 [lindex ${aGetAttr2} 0]
55 if { ${aGetAttr11} != ${aGetAttr21} } {
56    set IsGood 0
57    puts "aGetAttr11=${aGetAttr11}"
58    puts "aGetAttr21=${aGetAttr21}"
59    puts ${aMessage1}
60 }
61 set aGetAttr12 [lindex ${aGetAttr1} 1]
62 set aGetAttr22 [lindex ${aGetAttr2} 1]
63 if { ${aGetAttr12} != ${aGetAttr22} } {
64    set IsGood 0
65    puts "aGetAttr12=${aGetAttr12}"
66    puts "aGetAttr22=${aGetAttr22}"
67    puts ${aMessage1}
68 }
69
70 if { ${IsGood} == 0} {
71   puts "Add TDataStd_IntegerList attribute: Error"
72 } else {
73   puts "Add TDataStd_IntegerList attribute: OK"
74 }