This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3, committed] Fix filebuf_virtuals-8 for unsigned char platforms
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 07 Feb 2003 12:17:02 +0100
- Subject: [v3, committed] Fix filebuf_virtuals-8 for unsigned char platforms
Hi,
this patchlet, tested on x86 by myself, by Kaveh on mips
and by Mark Wielaard on powerpc, fixes a char signedness
sensitivity of this test, which I added a few days ago...
Paolo.
////////////
2003-02-07 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/filebuf_virtuals.cc (test08): Fix for
unsigned char platforms.
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- gcc/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc 2003/02/04 22:42:32 1.10
+++ gcc/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc 2003/02/07 11:00:35 1.11
@@ -542,8 +542,8 @@
public:
static bool eq(char c1, char c2)
{
- VERIFY( c1 >= 0 );
- VERIFY( c2 >= 0 );
+ VERIFY( c1 != 'X' );
+ VERIFY( c2 != 'X' );
return std::char_traits<char>::eq(c1, c2);
}
};
@@ -555,8 +555,8 @@
public:
MyBuf()
{
- std::memset(buffer, -1, sizeof(buffer));
- std::memset(buffer + 2, 0, 4);
+ std::memset(buffer, 'X', sizeof(buffer));
+ std::memset(buffer + 2, 'f', 4);
setg(buffer + 2, buffer + 2, buffer + 6);
}
};
@@ -567,7 +567,7 @@
bool test = true;
MyBuf mb;
- mb.sputbackc(0);
+ mb.sputbackc('a');
}
// libstdc++/9439, libstdc++/9425