c2f5b821 |
1 | puts "============" |
2 | puts "OCC28691" |
716cf4d9 |
3 | puts "Storage of Ocaf documents in XML file format in old document version" |
c2f5b821 |
4 | puts "============" |
5 | puts "" |
c2f5b821 |
6 | |
7 | NewDocument D XmlOcaf |
8 | SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour |
30fa5f67 |
9 | set FileV7 ${imagedir}/${casename}_doc7.xml |
10 | set FileV9 ${imagedir}/${casename}_doc9.xml |
c2f5b821 |
11 | SetNode D 0:1 |
12 | AISSet D 0:1 NS |
13 | |
14 | SaveAs D ${FileV9} |
15 | |
716cf4d9 |
16 | SetStorageFormatVersion D 7 |
c2f5b821 |
17 | SaveAs D ${FileV7} |
18 | |
19 | Close D |
20 | |
21 | puts "Testing for XML file format in new version document" |
b34d86cb |
22 | |
c2f5b821 |
23 | Open ${FileV9} D9 |
24 | |
25 | set info [Attributes D9 0:1] |
26 | if { [regexp "TDataStd_ExtStringArray" ${info}] != 1 } { |
27 | puts "Error : there is not TDataStd_ExtStringArray attribute in new version document" |
28 | } else { |
29 | puts "OK : there is TDataStd_ExtStringArray attribute in new version document" |
30 | } |
31 | if { [regexp "TDataStd_TreeNode" ${info}] != 1 } { |
32 | puts "Error : there is not TDataStd_TreeNode attribute in new version document" |
33 | } else { |
34 | puts "OK : there is TDataStd_TreeNode attribute in new version document" |
35 | } |
36 | if { [regexp "TDataXtd_Presentation" ${info}] != 1 } { |
37 | puts "Error : there is not TDataXtd_Presentation attribute in new version document" |
38 | } else { |
39 | puts "OK : there is TDataXtd_Presentation attribute in new version document" |
40 | } |
41 | set info [GetExtStringArray D9 0:1] |
42 | if { [regexp "Hello" ${info}] != 1 } { |
43 | puts "Error : there is not \"Hello\" word in TDataStd_ExtStringArray attribute in new version document" |
44 | } else { |
45 | puts "OK : there is \"Hello\" word in TDataStd_ExtStringArray attribute in new version document" |
46 | } |
47 | if { [regexp "hallo" ${info}] != 1 } { |
48 | puts "Error : there is not \"hallo\" word in TDataStd_ExtStringArray attribute in new version document" |
49 | } else { |
50 | puts "OK : there is \"hallo\" word in TDataStd_ExtStringArray attribute in new version document" |
51 | } |
52 | if { [regexp "Bonjour" ${info}] != 1 } { |
53 | puts "Error : there is not \"Bonjour\" word in TDataStd_ExtStringArray attribute in new version document" |
54 | } else { |
55 | puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in new version document" |
56 | } |
57 | |
58 | puts "\nTesting for XML file format in old version document" |
59 | Open ${FileV7} D7 |
60 | |
61 | set info [Attributes D7 0:1] |
62 | if { [regexp "TDataStd_ExtStringArray" ${info}] != 1 } { |
63 | puts "Error : there is not TDataStd_ExtStringArray attribute in old version document" |
64 | } else { |
65 | puts "OK : there is TDataStd_ExtStringArray attribute in old version document" |
66 | } |
67 | if { [regexp "TDataStd_TreeNode" ${info}] != 1 } { |
68 | puts "Error : there is not TDataStd_TreeNode attribute in old version document" |
69 | } else { |
70 | puts "OK : there is TDataStd_TreeNode attribute in old version document" |
71 | } |
72 | if { [regexp "TDataXtd_Presentation" ${info}] != 1 } { |
73 | puts "Error : there is not TDataXtd_Presentation attribute in old version document" |
74 | } else { |
75 | puts "OK : there is TDataXtd_Presentation attribute in old version document" |
76 | } |
77 | set info [GetExtStringArray D7 0:1] |
78 | if { [regexp "Hello" ${info}] != 1 } { |
79 | puts "Error : there is not \"Hello\" word in TDataStd_ExtStringArray attribute in old version document" |
80 | } else { |
81 | puts "OK : there is \"Hello\" word in TDataStd_ExtStringArray attribute in old version document" |
82 | } |
83 | if { [regexp "hallo" ${info}] != 1 } { |
84 | puts "Error : there is not \"hallo\" word in TDataStd_ExtStringArray attribute in old version document" |
85 | } else { |
86 | puts "OK : there is \"hallo\" word in TDataStd_ExtStringArray attribute in old version document" |
87 | } |
88 | if { [regexp "Bonjour" ${info}] != 1 } { |
89 | puts "Error : there is not \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document" |
90 | } else { |
91 | puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document" |
92 | } |
30fa5f67 |
93 | |
94 | file delete -force ${FileV7} |
95 | file delete -force ${FileV9} |