Boost logo

Boost :

From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-10-14 15:07:16


Thanks but because what I want to pass is effectively a PROGRAM string

"<< hex << showpoint << showbase << MySpecialManips ..."

AND I need a special ostream initialiser "setDefaults(oss)"

#define CHECK(manips, result)\
{\
        ostringstream oss;\
        setDefaults(oss);\
        oss << manips;\
        BOOST_CHECK_EQUAL(oss.str(), result);\
}

conlcude I must use a macro :-( Nasty but effective.

But your to_string looks most useful generally. Perhaps if I convert the
setDefaults to a manipulator and write

 oss << setdefaults << manips

Does this look feasible with your to_string?

to write

BOOST_CHECK_EQUAL(setDefaults << hex << showpoint << showbase <<
MySpecialManips, "expected string");

Thanks.

Paul

Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
mailto:pbristow_at_[hidden]

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of John Torjo
| Sent: Tuesday, October 14, 2003 10:21 AM
| To: Boost mailing list
| Subject: Re: [boost] Boost Test tools to test manipulators
| likehex,setw(15)...
|
|
| I might have understood this all wrong, but maybe this will help you:
|
| http://builder.com.com/5100-6370-5079969.html?tag=crm
|
| You can write what you wish, and as many manipulators as you wish.
| And at the end, it's automatically converted to string.
|
| Please email me if you want the source code.
|
| Best,
| John
|


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