Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2005-05-10 10:18:23


--- Howard Hinnant <hinnant_at_[hidden]> wrote:
 
> I know the Metrowerks library inside/out. I started looking at this
> last night but I'm pretty lost in the test code.

I see. It's not the clearest code in the world. It is logically simple but a
bit hard to debug due to the high number of combinations (and workarounds)
involved.

>
> Here's what I have so far:
>
> Failure inside of:
>
> template<typename Stream, typename String>
> static void stream_extractor(Bitset& b,
> Stream& is,
> String& str
> )
>
> at:
>
> if(stream_was_good)
> BOOST_CHECK(remainder == str.substr(after_digits));
>
> At this point remainder is a zero-length string, after_digits is 0 and
> str is length 359.

That's odd. after_digits is the position of the first character that follows 1s
and 0s. The 359-characters str parameter should be the long string defined in
bitset.hpp, thus you should have at least after_digits==359. I may be wrong
because I don't have the necessary time and calm to check the code from the
office but it might be worth examining this part. In particular if, for some
reason, is_one_or_zero() is immediately returning false.

>
> On entry to this routine b has length 1 and that element is true. I
> believe, but I am not positive that str is unmodified through this
> test, despite being passed by reference (as opposed to const ref).
>
> I've so far been unable to determine the state of the stream is on
> entry. But it looks completely hosed by the time the BOOST_CHECK is
> triggered. For example the iostate has the value 0x7E even though the
> highest numerical state it can possibly have is 0x07.

That's odd too.

I'll continue reading this thread via mail. Please keep me informed and sorry
for not being able to dig into this myself.

-- Genny

                
Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend. Check it out!
http://discover.yahoo.com/weekend.html


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