0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / bugs / caf / bug1919
CommitLineData
61c421bf 1puts "TODO OCC12345 ALL: OCC1919 Error"
2
3puts "================"
4puts "OCC1919"
5puts "================"
6puts ""
7#######################################################################################
8# Incorrect locale management in XmlDrivers_DocumentRetrievalDriver::Read()
9#######################################################################################
10
11pload QAcommands
12
13set USA_Label 0:10
14set Italian_Label 0:20
15set USA_Real 123.456
16set Italian_Real 123,456
17#set aFile ${filedir}/OCC1919-[file tail [info script]].xml
18set IsGood 1
19
20# Create document
21NewDocument D XmlOcaf
22UndoLimit D 100
23NewCommand D
24
25Label D ${USA_Label}
26Label D ${Italian_Label}
27
28# Set USA locale
29OCC1919_set en_US
30set en_US_local [lindex [OCC1919_get] 2]
31if { ${en_US_local} != "en_US" } {
32 puts "OCC1919 Error : USA - English (ISO-8859-1) locale not seted"
33 set IsGood 0
34}
35
36SetReal D ${USA_Label} ${USA_Real}
37
38# Get a value of the attribute
39set USA_IsDone [catch {set new_USA_Real [GetReal D ${USA_Label}]} message]
40if { ${USA_IsDone} != 0 || ${new_USA_Real}!=${USA_Real} } {
41 puts ${message}
42 puts "USA_Real=${USA_Real} new_USA_Real=${new_USA_Real} "
43 puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
44 set IsGood 0
45}
46
47# Set italian locale
48OCC1919_set it
49set it_local [lindex [OCC1919_get] 2]
50if { ${it_local} != "it" } {
51 puts "OCC1919 Error : Italian locale not seted"
52 set IsGood 0
53}
54
55OCC1919_real D ${Italian_Label} ${Italian_Real}
56
57# Get a value of the attribute
58set Italian_IsDone [catch {set new_Italian_Real [GetReal D ${Italian_Label}]} message]
59if { ${Italian_IsDone} != 0 || ${new_Italian_Real}!=${Italian_Real} } {
60 puts ${message}
61 puts "Italian_Real=${Italian_Real} new_Italian_Real=${new_Italian_Real}"
62 puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
63 set IsGood 0
64}
65
66# Get a value of the attribute
67set USA_IsDone [catch {set new_USA_Real [GetReal D ${USA_Label}]} message]
68if { ${USA_IsDone} != 0 || ${new_USA_Real}!=${Italian_Real} } {
69 puts ${message}
70 puts "Italian_Real=${Italian_Real} new_USA_Real=${new_USA_Real}"
71 puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
72 set IsGood 0
73}
74
75# Store the document
30fa5f67 76set aTmpFile ${imagedir}/${casename}.xml
77file delete $aTmpFile
78SaveAs D $aTmpFile
79if { ![file exists $aTmpFile] } {
61c421bf 80 puts "OCC1919 Error : There is not file"
81 set IsGood 0
82}
61c421bf 83Close D
84
85# Set en_US locale
86OCC1919_set en_US
87set en_US_local [lindex [OCC1919_get] 2]
88if { ${en_US_local} != "en_US" } {
89 puts "OCC1919 Error : USA - English (ISO-8859-1) locale not seted"
90 set IsGood 0
91}
92
93# Restore the document
30fa5f67 94Open $aTmpFile DD
95file delete -force $aTmpFile
61c421bf 96
97# Get a value of the attribute
98set USA_IsDone [catch {set new_USA_Real [GetReal DD ${USA_Label}]} message]
99set Italian_IsDone [catch {set new_Italian_Real [GetReal DD ${Italian_Label}]} message]
100if { ${USA_IsDone} != 0 || ${Italian_IsDone} != 0 || ${new_USA_Real}!=${new_Italian_Real} || ${new_Italian_Real}!=${USA_Real} } {
101 puts ${message}
102 puts "USA_Real=${USA_Real} Italian_Real=${Italian_Real}"
103 puts "new_USA_Real=${new_USA_Real} new_Italian_Real=${new_Italian_Real}"
104 puts "OCC1919 Error : Get bad value of TDataStd_Real attribute from restoring document"
105 set IsGood 0
106}
107
108if { ${IsGood} == 1 } {
109 puts "OCC1919 OK"
110} else {
111 puts "OCC1919 Error"
112}
113
114set make_photo 0