0030101: Application Framework - A mistake reading a RealArray attribute with too...
[occt.git] / tests / bugs / caf / bug29452
CommitLineData
e13b9464 1puts "=========="
2puts "OCC29452"
3puts "=========="
4puts ""
5###################################################
6# XmlMDataStd_RealDriver: Failed to read an Ocaf XML document with 1.#QNAN value
7###################################################
8
9# Check for presence of warning message
10puts "REQUIRED ALL: Cannot retrieve real member for RealArray attribute"
11
12set BugNumber OCC29452
13set file [locate_data_file bug29452.xml]
14
15catch {Close D}
16set res [Open $file D]
17
18set real [GetReal D 0:1]
19set rlst [GetRealList D 0:1]
20set rarr [GetRealArray D 0:1]
00cdefc7 21set rarr2 [GetRealArray D 0:2]
e13b9464 22
23# Check for read values
24checkreal "Real value" [lindex $rlst 0] 1.1 0 1e-15
25checkreal "Real value" [lindex $rlst 2] 3.3 0 1e-15
26checkreal "Real value" [lindex $rarr 0] 0.111 0 1e-15
27checkreal "Real value" [lindex $rarr 3] 123. 0 1e-15
28checkreal "Real value" [lindex $rarr 4] 3.14e12 0 1e-15
00cdefc7 29checkreal "Real value" [lindex $rarr2 0] 2 0 1e-15
30checkreal "Real value" [lindex $rarr2 1] 2.1219957909652723e-314 0 1e-15
31checkreal "Real value" [lindex $rarr2 2] 5 0 1e-15
e13b9464 32foreach inf [list $real [lindex $rlst 3]] {
33 if { [string compare "$inf" "inf"] &&
34 [string compare "$inf" "infinity"] &&
35 [string compare "$inf" "1.#INF"] } {
36 puts "Error: Real value is read as \"$inf\", expected infinity"
37 }
38}
39foreach nan [list [lindex $rlst 1] [lindex $rarr 1] [lindex $rarr 2]] {
40 if { [string compare "$nan" "nan"] &&
41 [string compare "$nan" "1.#QNAN"] } {
42 puts "Error: Real value is read as \"$nan\", expected NAN"
43 }
44}