Opened 12 years ago

Closed 12 years ago

#5037 closed Bugs (fixed)

test_output fails on trivial "inf" and "nan" formatting differences

Reported by: Jim Bell <jim@…> Owned by: Steven Watanabe
Milestone: Boost 1.46.0 Component: units
Version: Boost Development Trunk Severity: Regression
Keywords: Cc:

Description

test_output fails on trivial, platform-specific output formatting differences. In the output below you see different forms of expected results: "1.#INF", "-1.#INF", "-nan", etc.

Since (I think) C++ doesn't define these specifically, perhaps a regex should be used to capture all variants.

Mingw-64 GCC 4.6, as of 1/4/2011:

../libs/units/test/test_output.cpp(322): error in "test_output_autoprefixed_quantity_name": check ss.str() == "inf meter" failed [1.#INF meter != inf meter]
../libs/units/test/test_output.cpp(322): error in "test_output_autoprefixed_quantity_name": check ss.str() == L"inf meter" failed
../libs/units/test/test_output.cpp(323): error in "test_output_autoprefixed_quantity_name": check ss.str() == "-inf meter" failed [-1.#INF meter != -inf meter]
../libs/units/test/test_output.cpp(323): error in "test_output_autoprefixed_quantity_name": check ss.str() == L"-inf meter" failed
../libs/units/test/test_output.cpp(324): error in "test_output_autoprefixed_quantity_name": check ss.str() == "nan meter" failed [1.#QNAN meter != nan meter]
../libs/units/test/test_output.cpp(324): error in "test_output_autoprefixed_quantity_name": check ss.str() == L"nan meter" failed
../libs/units/test/test_output.cpp(325): error in "test_output_autoprefixed_quantity_name": check ss.str() == "-nan meter" failed [-1.#IND meter != -nan meter]
../libs/units/test/test_output.cpp(325): error in "test_output_autoprefixed_quantity_name": check ss.str() == L"-nan meter" failed

FreeBSD8 GCC 4.2.1, as of 1/4/2011:

../libs/units/test/test_output.cpp(325): error in "test_output_autoprefixed_quantity_name": check ss.str() == "-nan meter" failed [nan meter != -nan meter]
../libs/units/test/test_output.cpp(325): error in "test_output_autoprefixed_quantity_name": check ss.str() == L"-nan meter" failed

Other platform failures are similiar.

Change History (4)

comment:1 by Steven Watanabe, 12 years ago

Owner: changed from Matthias Schabel to Steven Watanabe
Status: newassigned

comment:2 by Steven Watanabe, 12 years ago

(In [67668]) Regexify testing of infinity and NaN. Refs #5037.

comment:3 by Steven Watanabe, 12 years ago

This has been fixed in trunk and release.

comment:4 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.