Boost logo

Boost :

Subject: Re: [boost] [Test] Problem testing with wstring
From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2009-08-26 20:37:15


Jared McIntyre <jmcintyre <at> dfsoftware.com> writes:
>
> Whoops. In the rush to simplify the example, I hadn't noticed that the
> error messages had changed. Here is the error when a wstring is
> properly constructed:

<snip>
 
> Sorry about that. The following code will work as a workaround, but I
> was wondering what others are doing when they have a wstring.
>
> std::wstring testString;
> BOOST_CHECK_EQUAL(testString.c_str(), L"");
>

Another option is BOOST_CHECK_MESSAGE((testString == L""), "testString doesn't
match an empty wcstring!");. Or just define operator<<(std::ostream&,
std::wstring const&) in your test module.

-Ryan


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