0027970: Improvement of standard attributes usability - containers.
[occt.git] / tests / caf / basic / T7
1 #INTERFACE CAF
2 # Basic attributes
3 # TDataStd_ExtStringList
4 #
5 # Testing attribute: User defined (additional GUID) TDataStd_ExtStringList
6 #
7 # Testing command:   SetExtStringList
8 # Testing command:   GetExtStringList
9 #
10
11 puts "caf001-T7"
12 set QA_DUP 0
13
14 # Add an attributes to a data framework
15 set aSetAttr11 xxxx
16 set aSetAttr12 yyyyy
17 set aLabel 0:2
18
19 set aGuid1 "12e94541-6dbc-11d4-b9c8-0060b0ee281b"
20
21 SetExtStringList   D ${aLabel} ${aSetAttr11} ${aSetAttr12}
22 SetExtStringList 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 # Save Document
39 Format D XmlOcaf
40 set aFile ${imagedir}/caf001-T7.xml
41 SaveAs D ${aFile}; 
42 Close D
43
44 #Open a document
45 Open ${aFile} D
46
47 # Get a value of the attribute
48 set IsGood 1
49 set aMessage1 "Add TDataStd_ExtStringList attribute: Error"
50 set aGetAttr1 [GetExtStringList D ${aLabel}]
51 set aLen1 [llength ${aGetAttr1}]
52 set aGetAttr2 [GetExtStringList D ${aLabel} ${aGuid1}]
53 set aLen2 [llength ${aGetAttr2}]
54
55 if { ${aLen1} != ${aLen2}} {
56    set IsGood 0
57    puts "aLen1=${aLen1}"
58    puts "aLen2=${aLen2}"
59    puts ${aMessage1}
60 }
61
62 set aGetAttr11 [lindex ${aGetAttr1} 0]
63 set aGetAttr21 [lindex ${aGetAttr2} 0]
64 if { ${aGetAttr11} != ${aGetAttr21} } {
65    set IsGood 0
66    puts "aGetAttr11=${aGetAttr11}"
67    puts "aGetAttr21=${aGetAttr21}"
68    puts ${aMessage1}
69 }
70 set aGetAttr12 [lindex ${aGetAttr1} 1]
71 set aGetAttr22 [lindex ${aGetAttr2} 1]
72 if { ${aGetAttr12} != ${aGetAttr22} } {
73    set IsGood 0
74    puts "aGetAttr12=${aGetAttr12}"
75    puts "aGetAttr22=${aGetAttr22}"
76    puts ${aMessage1}
77 }
78
79 if { ${IsGood} == 0} {
80   puts "Add TDataStd_ExtStringList attribute: Error"
81 } else {
82   puts "Add TDataStd_ExtStringList attribute: OK"
83 }