Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] BOOST_CHECK_EQUAL and wchar_t
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-02-11 02:09:55


Alexander <gutenev <at> gmail.com> writes:

>
> The following code:
>
> BOOST_CHECK_EQUAL("boo", "boo");
> BOOST_CHECK_EQUAL("boo", "bar");
> BOOST_CHECK_EQUAL(L"boo", L"boo");
> BOOST_CHECK_EQUAL(L"boo", L"bar");
>
> Gives the following results
>
> test.cpp(368): error in "Strings": check "boo" == "bar" failed [boo != bar]
> test.cpp(370): error in "Strings": check L"boo" == L"bar" failed [00B6FAA4
> != 00B6FA90]
>
> Can this be fixed ?

Depends.

This particular problem is a result of incorrect printing operation of wchar_t
strings into ostream. You can probably implement one yourself, which does the
better job.

In general there are some issues with wide char support in Boost.Test, but they
are not so trivial to address. Especially in backward compatible manner.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net