How to make boost.test log wstring?

Boost.test logs to ostream, which does not have an operator for wstring. Consequently, I cannot test wstring values. How can I fix this?

On Fri, Feb 5, 2010 at 12:53 PM, Alexey Badalov
Boost.test logs to ostream, which does not have an operator for wstring. Consequently, I cannot test wstring values. How can I fix this?
For the time being you can convert it to a UTF-8 encoded std::string, it will not be a perfect mapping, but may be accurate enough for your needs until someone else suggests something better.

Alexey Badalov
Boost.test logs to ostream, which does not have an operator for wstring. Consequently, I cannot test wstring values. How can I fix this?
You can send in a patch which will make Boost.Test work with both ostream and wostream. Also you cna write an operator << (ostream&,wstring const&) Gennadiy

"Gennadiy Rozental"
You can send in a patch which will make Boost.Test work with both ostream and wostream. Also you cna write an operator << (ostream&,wstring const&)
I tried to put the operator above "#include

Alexey Badalov
"Gennadiy Rozental"
wrote in message news:loom.20100206T071834-814 <at> post.gmane.org... You can send in a patch which will make Boost.Test work with both ostream and wostream. Also you cna write an operator << (ostream&,wstring const&)
I tried to put the operator above "#include
", but the same error persists, and mine is not in the candidate operator overload list displayed in the message - only operators defined in <ostream> are
Unfortunately I believe there only way to circumvent this it to define the operator in namespace std. Gennadiy

In article
Boost.test logs to ostream, which does not have an operator for wstring. Consequently, I cannot test wstring values. How can I fix this?
One alternative is to simply use BOOST_CHECK and the == operator: BOOST_CHECK(obj.get_wstring() == L"Expected"); Lacks the nice output, but it's quite easy.
participants (4)
-
Alexey Badalov
-
Gennadiy Rozental
-
Noah Roberts
-
OvermindDL1