File: bug1919

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (114 lines) | stat: -rw-r--r-- 3,449 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
puts "TODO OCC12345 ALL: OCC1919 Error : Italian locale not seted"
puts "TODO OCC12345 ALL: OCC1919 Error"

puts "================"
puts "OCC1919"
puts "================"
puts ""
#######################################################################################
# Incorrect locale management in XmlDrivers_DocumentRetrievalDriver::Read()
#######################################################################################

pload QAcommands

set USA_Label 0:10
set Italian_Label 0:20
set USA_Real 123.456
set Italian_Real 123,456
#set aFile ${filedir}/OCC1919-[file tail [info script]].xml
set IsGood 1

# Create document
NewDocument D XmlOcaf
UndoLimit D 100
NewCommand D

Label D ${USA_Label}
Label D ${Italian_Label}

# Set USA locale
OCC1919_set en_US
set en_US_local [lindex [OCC1919_get] 2]
if { ${en_US_local} != "en_US" } {
   puts "OCC1919 Error : USA - English (ISO-8859-1) locale not seted"
   set IsGood 0
}

SetReal D ${USA_Label} ${USA_Real}

# Get a value of the attribute
set USA_IsDone [catch {set new_USA_Real [GetReal D ${USA_Label}]} message]
if { ${USA_IsDone} != 0 || ${new_USA_Real}!=${USA_Real} } {
   puts ${message}
   puts "USA_Real=${USA_Real} new_USA_Real=${new_USA_Real} "
   puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
   set IsGood 0
}

# Set italian locale
OCC1919_set it
set it_local [lindex [OCC1919_get] 2]
if { ${it_local} != "it" } {
   puts "OCC1919 Error : Italian locale not seted"
   set IsGood 0
}

OCC1919_real D ${Italian_Label} ${Italian_Real}

# Get a value of the attribute
set Italian_IsDone [catch {set new_Italian_Real [GetReal D ${Italian_Label}]} message]
if { ${Italian_IsDone} != 0 || ${new_Italian_Real}!=${Italian_Real} } {
   puts ${message}
   puts "Italian_Real=${Italian_Real} new_Italian_Real=${new_Italian_Real}"
   puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
   set IsGood 0
}

# Get a value of the attribute
set USA_IsDone [catch {set new_USA_Real [GetReal D ${USA_Label}]} message]
if { ${USA_IsDone} != 0 || ${new_USA_Real}!=${Italian_Real} } {
   puts ${message}
   puts "Italian_Real=${Italian_Real} new_USA_Real=${new_USA_Real}"
   puts "OCC1919 Error : Get bad value of TDataStd_Real attribute"
   set IsGood 0
}

# Store the document
file delete ${imagedir}/OCC1919-M6.xml
SaveAs D ${imagedir}/OCC1919-M6.xml
if { ![file exists ${imagedir}/OCC1919-M6.xml] } {
   puts "OCC1919 Error : There is not file"
   set IsGood 0
}
catch {exec chmod 777 ${imagedir}/OCC1919-M6.xml}
Close D

# Set en_US locale 
OCC1919_set en_US
set en_US_local [lindex [OCC1919_get] 2]
if { ${en_US_local} != "en_US" } {
   puts "OCC1919 Error : USA - English (ISO-8859-1) locale not seted"
   set IsGood 0
}

# Restore the document
Open ${imagedir}/OCC1919-M6.xml DD

# Get a value of the attribute
set USA_IsDone [catch {set new_USA_Real [GetReal DD ${USA_Label}]} message]
set Italian_IsDone [catch {set new_Italian_Real [GetReal DD ${Italian_Label}]} message]
if { ${USA_IsDone} != 0 || ${Italian_IsDone} != 0 || ${new_USA_Real}!=${new_Italian_Real} || ${new_Italian_Real}!=${USA_Real} } {
   puts ${message}
   puts "USA_Real=${USA_Real} Italian_Real=${Italian_Real}"
   puts "new_USA_Real=${new_USA_Real} new_Italian_Real=${new_Italian_Real}"
   puts "OCC1919 Error : Get bad value of TDataStd_Real attribute from restoring document"
   set IsGood 0
}

if { ${IsGood} == 1 } {
  puts "OCC1919 OK"
} else {
  puts "OCC1919 Error"
}

set make_photo 0