Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-09-29 13:05:46


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
| Sent: 29 September 2005 17:02
| To: boost_at_[hidden]
| Subject: Re: [boost] Unit test framework with 1.33 - logging
|
|
| > | I had been using Boost test with 1.32 successfully
| > |
| > | #include <boost/test/test_tools.hpp>
| > | #include <boost/test/floating_point_comparison.hpp> // Extra
| > | test tool for
| > | FP comparison.
| > |
| > | but with 1.33 it fails to compile at
| > |
| > | using boost::unit_test_framework::unit_test_log;
| > | using boost::unit_test_framework::log_level;
| > |
| > | and used this to control the log threshold
| > |
| > |
| > | unit_test_log::instance().set_log_threshold_level_by_name("tes
| > | t_suite");
| > |
| > | and to switch the log file
| > |
| > | unit_test_log::instance().set_log_stream(flog); // Switch to log
| > | file.// unit_test_log::instance().set_log_stream(cout);
| > | // Switch back to
| > | cout,
| > |
| > | But this has been removed in 1.33
| > |
| > | but I am unclear how to replicate this sort of function.
| > |
| > | Suggestions?
| > |
| > | Thanks
| > |
| > | Paul
|
| 1. Include <boost/test/unit_test_log.hpp>
| 2. use boost::unit_test::unit_test_log::set_threshold_level(
| log_level_value ) to set log level, where log_level_value is
| the value of
| enum log_level (see <boost/test/detail/log_level.hpp>).
| 3. use boost::unit_test::unit_test_log::set_stream(
| std::ostream& ) to reset
| log stream
|
| Gennadiy

Thanks - apart for the deliberate mistake to check that I am paying
attention ;-)
(Just in case others are not !)

        using boost::unit_test::unit_test_log;
        // Change log level.
        unit_test_log.set_threshold_level(boost::unit_test::log_warnings);
...................^

and boost::unit_test::unit_test_log.set_stream(cerr);
...................................^

Boost Test 1.33 looks much improved - but a lot of significant changes, for
which documentation would be nice ;-)

Paul

PS
> Dumping objects ->
> {150} normal block at 0x003163F8, 12 bytes long.
> Data: <long double > 6C 6F 6E 67 20 64 6F 75 62 6C 65 00
> {149} normal block at 0x003163C0, 8 bytes long.
> Data: < c1 0a1 > F8 63 31 00 30 61 31 00
> {139} normal block at 0x00316168, 7 bytes long.
> Data: <double > 64 6F 75 62 6C 65 00
> {138} normal block at 0x00316130, 8 bytes long.
> Data: <ha1 `41 > 68 61 31 00 60 34 31 00
> {126} normal block at 0x00313498, 6 bytes long.
> Data: <float > 66 6C 6F 61 74 00
> {125} normal block at 0x00313460, 8 bytes long.
> Data: < 41 > 98 34 31 00 00 00 00 00
> Object dump complete.
> Build log was saved at

I saw these link of leaks with STLPort. My guess is that iostream
implementation is leaking.

:-((


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk