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