Opened 10 years ago

Closed 7 years ago

#7257 closed Bugs (fixed)

Boost.Test alters and does not restore ostream precision after any Test macro

Reported by: Paul A. Bristow Owned by: Raffi Enficiaud
Milestone: Boost 1.60.0 Component: test
Version: Boost 1.51.0 Severity: Problem
Keywords: test precision Cc:

Description

Boost.Test alters and does not restore ostream precision after any Test macro.

std::cout.precision(17);

std::streamsize precision1 = std::cout.precision(); 17

BOOST_TEST_MESSAGE(""); or any BOOST_TEST_* calls.

std::streamsize precision2 = std::cout.precision(); 6 (default)

BOOST_CHECK_EQUAL(precision1, precision2); expect both 17

This means that it is necessary to reset precision after every call to a BOOST_TEST_* macro, which is a tiresome and unexpected feature.

Change History (3)

comment:1 by Raffi Enficiaud, 7 years ago

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

comment:2 by Raffi Enficiaud, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0

comment:3 by Raffi Enficiaud, 7 years ago

Resolution: fixed
Status: assignedclosed

I just checked, and the fix should be visible in 1.59 already. Leaving for 1.60 as it appears in the changelog.

Note: See TracTickets for help on using tickets.