Commit 4debe14d by Paolo Carlini Committed by Paolo Carlini

ostream_inserter_arith.cc (test03): Fix to deal correctly with both 32 bit and 64 bit architectures

2002-01-28  Paolo Carlini  <pcarlini@unitus.it>

	* testsuite/27_io/ostream_inserter_arith.cc (test03):
	Fix to deal correctly with both 32 bit and 64 bit architectures

From-SVN: r49295
parent 7dc3f8c0
2002-01-28 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/ostream_inserter_arith.cc (test03):
Fix to deal correctly with both 32 bit and 64 bit architectures
2002-01-25 Loren Rittle <ljrittle@acm.org>
* testsuite/thread/pthread1.cc: Use one condition variable
......
......@@ -312,15 +312,28 @@ test03()
ostream o(&strbuf);
o << oct << s << ' ' << hex << s;
VERIFY( strbuf.str() == "177777 ffff" ); // Assuming 2byte-shorts
if (sizeof(short) == 2)
VERIFY( strbuf.str() == "177777 ffff" );
else // sizeof(short) == 4
VERIFY( strbuf.str() == "37777777777 ffffffff" );
strbuf.str(str_blank);
o << oct << i << ' ' << hex << i;
if (sizeof(int) == 2)
VERIFY( strbuf.str() == "177777 ffff" );
else if (sizeof(int) == 4)
VERIFY( strbuf.str() == "37777777777 ffffffff" );
else // sizeof(int) == 8
VERIFY( strbuf.str() == "1777777777777777777777 "
"ffffffffffffffff" );
strbuf.str(str_blank);
o << oct << l << ' ' << hex << l;
if (sizeof(long) == 4)
VERIFY( strbuf.str() == "37777777777 ffffffff" );
else // sizeof(long) == 8
VERIFY( strbuf.str() == "1777777777777777777777 "
"ffffffffffffffff" );
strbuf.str(str_blank);
o << showpos << hex << showbase << 11;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment