Subject: [Boost-bugs] [Boost C++ Libraries] #4785: test_output fails on systems that don't zero-fill the exponent to three digits
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-25 10:56:54
#4785: test_output fails on systems that don't zero-fill the exponent to three
digits
----------------------------------------+-----------------------------------
Reporter: Jim Bell <jim@â¦> | Owner: matthiasschabel
Type: Bugs | Status: new
Milestone: Boost-1.45.0 | Component: units
Version: Boost Development Trunk | Severity: Regression
Keywords: |
----------------------------------------+-----------------------------------
test_output fails to match strings exactly on systems that don't zero-fill
the exponent in scientific notation to three digits, or
boost::units::engineering_prefix doesn't set that explicitly as it should.
So you get
{{{
"9.99999e-25 meter" != "9.99999e-025 meter"
}}}
even though those two values are clearly the same.
If controlling this is as difficult as it seems to be (see
[http://stackoverflow.com/questions/268604/how-to-set-the-width-of-the-
exponent-field-for-an-ostream here]), you could change the comparison to a
regex_match with the regex
{{{
"9\.99999e-0?25 meter"
}}}
----
{{{
Run [2010-10-23 06:57:11 UTC]: fail
Running 14 test cases...
../libs/units/test/test_output.cpp(280): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "9.99999e-025
meter" failed [9.99999e-25 meter != 9.99999e-025 meter]
../libs/units/test/test_output.cpp(280): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"9.99999e-025
meter" failed
../libs/units/test/test_output.cpp(281): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "1e+028 meter"
failed [1e+28 meter != 1e+028 meter]
../libs/units/test/test_output.cpp(281): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"1e+028
meter" failed
../libs/units/test/test_output.cpp(282): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "1.5e-025
meter" failed [1.5e-25 meter != 1.5e-025 meter]
../libs/units/test/test_output.cpp(282): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"1.5e-025
meter" failed
../libs/units/test/test_output.cpp(283): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "1.5e+028
meter" failed [1.5e+28 meter != 1.5e+028 meter]
../libs/units/test/test_output.cpp(283): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"1.5e+028
meter" failed
../libs/units/test/test_output.cpp(285): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "3.40282e+038
meter" failed [3.40282e+38 meter != 3.40282e+038 meter]
../libs/units/test/test_output.cpp(285): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"3.40282e+038
meter" failed
../libs/units/test/test_output.cpp(286): error in
"test_output_autoprefixed_quantity_name": check ss.str() == "1.17549e-038
meter" failed [1.17549e-38 meter != 1.17549e-038 meter]
../libs/units/test/test_output.cpp(286): error in
"test_output_autoprefixed_quantity_name": check ss.str() == L"1.17549e-038
meter" failed
../libs/units/test/test_output.cpp(341): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
"9.99999e-025 m" failed [9.99999e-25 m != 9.99999e-025 m]
../libs/units/test/test_output.cpp(341): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
L"9.99999e-025 m" failed
../libs/units/test/test_output.cpp(342): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == "1e+028 m"
failed [1e+28 m != 1e+028 m]
../libs/units/test/test_output.cpp(342): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == L"1e+028 m"
failed
../libs/units/test/test_output.cpp(343): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == "1.5e-025 m"
failed [1.5e-25 m != 1.5e-025 m]
../libs/units/test/test_output.cpp(343): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == L"1.5e-025
m" failed
../libs/units/test/test_output.cpp(344): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == "1.5e+028 m"
failed [1.5e+28 m != 1.5e+028 m]
../libs/units/test/test_output.cpp(344): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() == L"1.5e+028
m" failed
../libs/units/test/test_output.cpp(346): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
"3.40282e+038 m" failed [3.40282e+38 m != 3.40282e+038 m]
../libs/units/test/test_output.cpp(346): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
L"3.40282e+038 m" failed
../libs/units/test/test_output.cpp(347): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
"1.17549e-038 m" failed [1.17549e-38 m != 1.17549e-038 m]
../libs/units/test/test_output.cpp(347): error in
"test_output_autoprefixed_quantity_symbol": check ss.str() ==
L"1.17549e-038 m" failed
*** 24 failures detected in test suite "Master Test Suite"
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4785> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC