Confusion about output_test_stream in the testing tools

I have a unit test case that includes #include <boost/test/auto_unit_test.hpp> #include <boost/test/floating_point_comparison.hpp> // I will try without the unit test namespace // 1.32 using boost::test_toolbox::ostream_test_stream; using boost::test_toolbox::output_test_stream; output_test_stream ostream; This worked in 1.32 (I think--the comment makes it sound as if it shouldn't). But in 1.33 I get error: `output_test_stream' not declared Turning to the documentation, I couldn't find any mention of this navigating the docs for boost.test (including looking at the detailed release notes). However, when I did a site search I found http://www.boost.org/libs/test/doc/components/test_tools/output_test_stream_... That page itself is confusing. the heading is boost::test_tools::ostream_test_stream but the class definition and other material use output_test_stream. The file test/output_test_stream.hpp names the class output test stream. Can anyone clarify what's going on? Either the documentation needs to be tweaked, or I'm confused, or both. Ross

I have a unit test case that includes #include <boost/test/auto_unit_test.hpp> #include <boost/test/floating_point_comparison.hpp> // I will try without the unit test namespace // 1.32 using boost::test_toolbox::ostream_test_stream; using boost::test_toolbox::output_test_stream;
output_test_stream ostream;
This worked in 1.32 (I think--the comment makes it sound as if it shouldn't). But in 1.33 I get error: `output_test_stream' not declared
Sorry for unclear docs. output_test_stream reside in subnamespace test_tools now. Though I expect old namespace still to work. Because test_tools.hpp contains: namespace test_toolbox = test_tools; I am working on documentation update at the moment. Hopefully next release this confusion is going to be remedied. HTH, Gennadiy

I have a unit test case that includes #include <boost/test/auto_unit_test.hpp> #include <boost/test/floating_point_comparison.hpp> // I will try without the unit test namespace // 1.32 using boost::test_toolbox::ostream_test_stream; using boost::test_toolbox::output_test_stream;
output_test_stream ostream;
This worked in 1.32 (I think--the comment makes it sound as if it shouldn't). But in 1.33 I get error: `output_test_stream' not declared
Sorry for unclear docs. output_test_stream reside in subnamespace test_tools now. Though I expect old namespace still to work. Because test_tools.hpp contains:
namespace test_toolbox = test_tools;
I am working on documentation update at the moment. Hopefully next release this confusion is going to be remedied.
HTH,
Gennadiy Thanks. I think the key thing I was missing was the appropriate include, which I guess is necessary now but didn't used to be needed. Here's a snippet of the code that seemed to work (I'm still having
On Thu, Dec 22, 2005 at 10:55:18AM -0500, Gennadiy Rozental wrote: problems, but I think they're unrelated): #include <boost/version.hpp> #include <boost/test/auto_unit_test.hpp> #include <boost/test/floating_point_comparison.hpp> // I will try without the unit test namespace // 1.32 using boost::test_toolbox::ostream_test_stream; #if BOOST_VERSION>=103300 #include <boost/test/output_test_stream.hpp> using boost::test_tools::output_test_stream; #warning doing the 1.33 thing #else using boost::test_toolbox::output_test_stream; #endif Ross

Thanks. I think the key thing I was missing was the appropriate include, which I guess is necessary now but didn't used to be needed. [...] #include <boost/test/output_test_stream.hpp>
Yes. In 1.33 output_test_stream.hpp is not included in test_tools.hpp anymore. You need to include one explicetly. Gennadiy

For the record, I did just notice this at http://www.boost.org/libs/test/doc/components/test_tools/index.html: "In addition to toolbox, the Test Tools also contains separate ostream_test_stream tool. This is class designed to significantly simplify correctness testing of the ostream based output procedures. For detailed description of it's interface and usage see the ostream_test_stream page." So there is a pointer to the ostream stuff in the docs. Ross
participants (2)
-
Gennadiy Rozental
-
Ross Boylan