Martin Sebor
Mon, 02 Jul 2007 08:55:22 -0700
Farid Zaripov wrote:
-----Original Message----- From: Martin Sebor [EMAIL PROTECTED] 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
Is this still 27.stringbuf.virtuals.cpp? I don't see any rw_error() in there.The basic_stringbuf<>::pbackfail() test(line 637) expected EOF == -1 and issues rw_error() diagnostic on whar_t tests.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.