40093367 |
1 | #INTERFACE CAF |
2 | puts "================" |
3 | puts "OCC6493" |
4 | puts "================" |
5 | puts "" |
6 | ###################################################### |
7 | # No binary persistence for TDataStd_ExtStringArray attribute |
8 | ###################################################### |
9 | |
10 | # Basic attributes |
11 | # |
12 | # Testing attribute: TDataStd_ExtStringArray |
13 | # |
14 | # Testing command: SetExtStringArray |
15 | # Testing command: GetExtStringArray |
16 | # |
17 | |
18 | # ANALOG: puts "caf001-M3" |
19 | set QA_DUP 0 |
20 | |
21 | # Create a new document and set UndoLimit |
22 | NewDocument Doc BinOcaf |
23 | UndoLimit Doc 100 |
24 | |
25 | # Open a transaction |
26 | NewCommand Doc |
27 | |
28 | # Add an attribute to a data framework |
29 | set aFrom1 1 |
30 | set aTo1 2 |
31 | set aSetAttr11 "TDataStd" |
32 | set aSetAttr12 "ExtStringArray" |
33 | set aLabel 0:2 |
34 | set isDelta 0 |
35 | SetExtStringArray Doc ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12} |
36 | |
37 | # Close/Open the transaction |
38 | NewCommand Doc |
39 | |
40 | # Save the document |
8418c617 |
41 | set aFile ${imagedir}/OCC6493-[file tail [info script]].cbf |
40093367 |
42 | file delete ${aFile} |
43 | catch {SaveAs Doc ${aFile}} |
44 | if { ![file exists ${aFile}] } { |
45 | puts "There is not ${aFile} file; SaveAs command: Error" |
46 | puts "OCC6493: ERROR (case 1)" |
47 | } |
48 | #catch {exec chmod 777 ${aFile}} |
49 | |
50 | # Restore the document |
51 | Close Doc |
52 | catch {Open ${aFile} DDoc} |
53 | |
54 | # Get a value of the attribute |
55 | set aGetAttr3 "" |
56 | set aMessage3 "Get a value of TDataStd_ExtStringArray attribute from restoring document: Error" |
57 | set IsDone [catch {set aGetAttr3 [GetExtStringArray DDoc ${aLabel}]} aResult] |
58 | if { ${IsDone} != 0 } { |
59 | puts ${aMessage3} |
60 | puts "OCC6493: ERROR (case 2)" |
61 | } |
62 | set aLen3 [llength ${aGetAttr3}] |
63 | if { ${aLen3} != [expr ${aTo1} - ${aFrom1} + 1] } { |
64 | puts "aLen3=${aLen3}" |
65 | puts ${aMessage3} |
66 | puts "OCC6493: ERROR (case 3)" |
67 | } |
68 | set aGetAttr41 [lindex ${aGetAttr3} 0] |
69 | if { ${aSetAttr11} != ${aGetAttr41} } { |
70 | puts "aGetAttr41=${aGetAttr41}" |
71 | puts ${aMessage3} |
72 | puts "OCC6493: ERROR (case 4)" |
73 | } |
74 | set aGetAttr42 [lindex ${aGetAttr3} 1] |
75 | if { ${aSetAttr12} != ${aGetAttr42} } { |
76 | puts "aGetAttr42=${aGetAttr42}" |
77 | puts ${aMessage3} |
78 | puts "OCC6493: ERROR (case 5)" |
79 | } else { |
80 | puts "Get a value of TDataStd_ExtStringArray attribute from restoring document: OK" |
81 | puts "OCC6493: OK" |
82 | } |