Skip to content
Snippets Groups Projects
Commit 4debe14d authored by Paolo Carlini's avatar Paolo Carlini Committed by Paolo Carlini
Browse files

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
No related merge requests found
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
......
......@@ -311,16 +311,29 @@ test03()
stringbuf strbuf;
ostream o(&strbuf);
o << oct << s << ' ' << hex << s;
VERIFY( strbuf.str() == "177777 ffff" ); // Assuming 2byte-shorts
o << oct << s << ' ' << hex << s;
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;
VERIFY( strbuf.str() == "37777777777 ffffffff" );
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;
VERIFY( strbuf.str() == "37777777777 ffffffff" );
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment