You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@epam.com> on 2007/07/02 17:31:32 UTC
RE: STDCXX tests fails and reasons [MSVC]
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Friday, June 29, 2007 8:17 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: STDCXX tests fails and reasons [MSVC]
>
> > Another problem in that test is difference between
> > char_traits<char>::eof() == int(-1)
> > and char_traits<wchar_t>::eof() == int (65536).
>
> char_traits<wchar_t>::eof() should equal WEOF. Is WEOF equal to
> 65536 on Windows?
Yes. Below is a definition of the WEOF in wctype.h (MSVC 8):
#define WEOF (wint_t)(0xFFFF)
> The test probably assumes that EOF is the
> same as WEOF which may not be a safe assumption.
Exactly right.
> > The basic_stringbuf<>::pbackfail() test
> > (line 637) expected EOF == -1 and issues rw_error() diagnostic on
> > whar_t tests.
>
> Is this still 27.stringbuf.virtuals.cpp? I don't see any
> rw_error() in there.
Line 637 is the first line with failed test (EOF expected, WEOF got).
// +----------------------------------------- initial sequence
(if any)
// | +---------------------------------- open mode
// | | +------------------------ gbump (gptr offset)
// | | | +-------------------- pbackfail argument
// | | | | +---------------- expected return
value
// | | | | | +----------- number of putback
positions
// | | | | | | +-------- number of read
positions
// | | | | | | | +----- number of write
positions
// | | | | | | | |
// V V V V V V V V
TEST (0, 0, 0, 'c', EOF, 0, 0, -1);
Farid.
Re: STDCXX tests fails and reasons [MSVC]
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com]
>> Sent: Monday, July 02, 2007 6:51 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: STDCXX tests fails and reasons [MSVC]
>>
>>>> The test probably assumes that EOF is the same as WEOF
>> which may not be a safe assumption.
>>> Exactly right.
>> So let's fix it :)
>
> Done: http://svn.apache.org/viewvc?view=rev&rev=553924
Looks good!
Thanks
Martin
RE: STDCXX tests fails and reasons [MSVC]
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Monday, July 02, 2007 6:51 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: STDCXX tests fails and reasons [MSVC]
>
> >> The test probably assumes that EOF is the same as WEOF
> which may not be a safe assumption.
> >
> > Exactly right.
>
> So let's fix it :)
Done: http://svn.apache.org/viewvc?view=rev&rev=553924
Farid.
Re: STDCXX tests fails and reasons [MSVC]
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>> Sent: Friday, June 29, 2007 8:17 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: STDCXX tests fails and reasons [MSVC]
>>
>>> Another problem in that test is difference between
>>> char_traits<char>::eof() == int(-1)
>>> and char_traits<wchar_t>::eof() == int (65536).
>> char_traits<wchar_t>::eof() should equal WEOF. Is WEOF equal to
>> 65536 on Windows?
>
> Yes. Below is a definition of the WEOF in wctype.h (MSVC 8):
>
> #define WEOF (wint_t)(0xFFFF)
>
>> The test probably assumes that EOF is the
>> same as WEOF which may not be a safe assumption.
>
> Exactly right.
So let's fix it :)
I didn't look very carefully (it's been over a year since I wrote
it) but I wonder if we could fix it by translating the EOF used
in test cases to char_traits<charT>::eof() in the test function.
Martin
>
>>> The basic_stringbuf<>::pbackfail() test
>>> (line 637) expected EOF == -1 and issues rw_error() diagnostic on
>>> whar_t tests.
>> Is this still 27.stringbuf.virtuals.cpp? I don't see any
>> rw_error() in there.
>
> Line 637 is the first line with failed test (EOF expected, WEOF got).
>
> // +----------------------------------------- initial sequence
> (if any)
> // | +---------------------------------- open mode
> // | | +------------------------ gbump (gptr offset)
> // | | | +-------------------- pbackfail argument
> // | | | | +---------------- expected return
> value
> // | | | | | +----------- number of putback
> positions
> // | | | | | | +-------- number of read
> positions
> // | | | | | | | +----- number of write
> positions
> // | | | | | | | |
> // V V V V V V V V
> TEST (0, 0, 0, 'c', EOF, 0, 0, -1);
>
> Farid.