mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0030101: Application Framework - A mistake reading a RealArray attribute with too small value
A case of reading of a very small value was skipped, for example: 2.1219957909652723e-314. Fixed in XmlMDataStd_RealArrayDriver.cxx and XmlMDataStd_RealListDriver.cxx // A test file bug29452.xml is extended to check this skipped case.
This commit is contained in:
parent
d850414af1
commit
00cdefc7a2
@ -128,8 +128,12 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste
|
|||||||
" for RealArray attribute as \"")
|
" for RealArray attribute as \"")
|
||||||
+ aValueStr + "\"";
|
+ aValueStr + "\"";
|
||||||
myMessageDriver->Send (aMessageString, Message_Warning);
|
myMessageDriver->Send (aMessageString, Message_Warning);
|
||||||
|
// skip the first space, if exists
|
||||||
|
while (*aValueStr != 0 && IsSpace (*aValueStr))
|
||||||
|
++aValueStr;
|
||||||
// skip to the next space separator
|
// skip to the next space separator
|
||||||
while (*aValueStr != 0 && ! IsSpace (*aValueStr)) ++aValueStr;
|
while (*aValueStr != 0 && ! IsSpace (*aValueStr))
|
||||||
|
++aValueStr;
|
||||||
}
|
}
|
||||||
aRealArray->SetValue(ind, aValue);
|
aRealArray->SetValue(ind, aValue);
|
||||||
}
|
}
|
||||||
|
@ -126,8 +126,12 @@ Standard_Boolean XmlMDataStd_RealListDriver::Paste(const XmlObjMgt_Persistent&
|
|||||||
" for RealList attribute as \"")
|
" for RealList attribute as \"")
|
||||||
+ aValueStr + "\"";
|
+ aValueStr + "\"";
|
||||||
myMessageDriver->Send(aMessageString, Message_Warning);
|
myMessageDriver->Send(aMessageString, Message_Warning);
|
||||||
|
// skip the first space, if exists
|
||||||
|
while (*aValueStr != 0 && IsSpace (*aValueStr))
|
||||||
|
++aValueStr;
|
||||||
// skip to the next space separator
|
// skip to the next space separator
|
||||||
while (*aValueStr != 0 && ! IsSpace (*aValueStr)) ++aValueStr;
|
while (*aValueStr != 0 && !IsSpace (*aValueStr))
|
||||||
|
++aValueStr;
|
||||||
}
|
}
|
||||||
aRealList->Append(aValue);
|
aRealList->Append(aValue);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ set res [Open $file D]
|
|||||||
set real [GetReal D 0:1]
|
set real [GetReal D 0:1]
|
||||||
set rlst [GetRealList D 0:1]
|
set rlst [GetRealList D 0:1]
|
||||||
set rarr [GetRealArray D 0:1]
|
set rarr [GetRealArray D 0:1]
|
||||||
|
set rarr2 [GetRealArray D 0:2]
|
||||||
|
|
||||||
# Check for read values
|
# Check for read values
|
||||||
checkreal "Real value" [lindex $rlst 0] 1.1 0 1e-15
|
checkreal "Real value" [lindex $rlst 0] 1.1 0 1e-15
|
||||||
@ -25,6 +26,9 @@ checkreal "Real value" [lindex $rlst 2] 3.3 0 1e-15
|
|||||||
checkreal "Real value" [lindex $rarr 0] 0.111 0 1e-15
|
checkreal "Real value" [lindex $rarr 0] 0.111 0 1e-15
|
||||||
checkreal "Real value" [lindex $rarr 3] 123. 0 1e-15
|
checkreal "Real value" [lindex $rarr 3] 123. 0 1e-15
|
||||||
checkreal "Real value" [lindex $rarr 4] 3.14e12 0 1e-15
|
checkreal "Real value" [lindex $rarr 4] 3.14e12 0 1e-15
|
||||||
|
checkreal "Real value" [lindex $rarr2 0] 2 0 1e-15
|
||||||
|
checkreal "Real value" [lindex $rarr2 1] 2.1219957909652723e-314 0 1e-15
|
||||||
|
checkreal "Real value" [lindex $rarr2 2] 5 0 1e-15
|
||||||
foreach inf [list $real [lindex $rlst 3]] {
|
foreach inf [list $real [lindex $rlst 3]] {
|
||||||
if { [string compare "$inf" "inf"] &&
|
if { [string compare "$inf" "inf"] &&
|
||||||
[string compare "$inf" "infinity"] &&
|
[string compare "$inf" "infinity"] &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user