Author: faridz
Date: Mon Jul 23 05:36:33 2007
New Revision: 558702
URL: http://svn.apache.org/viewvc?view=rev&rev=558702
Log:
2007-07-23 Farid Zaripov <[EMAIL PROTECTED]>
* 27.istream.manip.cpp (test_ws): ws() shouldn't affect the gcount()
value;
if initial state is not good, the result state should be state |
failbit.
Modified:
incubator/stdcxx/trunk/tests/iostream/27.istream.manip.cpp
Modified: incubator/stdcxx/trunk/tests/iostream/27.istream.manip.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/iostream/27.istream.manip.cpp?view=diff&rev=558702&r1=558701&r2=558702
==============================================================================
--- incubator/stdcxx/trunk/tests/iostream/27.istream.manip.cpp (original)
+++ incubator/stdcxx/trunk/tests/iostream/27.istream.manip.cpp Mon Jul 23
05:36:33 2007
@@ -301,10 +301,9 @@
skipws, err_type, err_after);
//////////////////////////////////////////////////////////////////
- // verify that gcount() correctly reflects the number of whitespace
- // characters extracted from the stream
+ // verify that gcount() value not affected (27.6.1.4 p1)
- rw_assert (extract == is.gcount (), 0, __LINE__,
+ rw_assert (0 == is.gcount (), 0, __LINE__,
"%u. std::ws (basic_istream<%s, %s >&)."
"gcount() == %d, got %d; whitespace is"
" '%c', input is %{*Ac}, initial rdstate() = %{Is}, "
@@ -321,7 +320,11 @@
// (i.e., the initial stream state), // except...
std::ios_base::iostate expect_state = state;
- if (!state && (white == cbuf [0] || !err_after)) {
+ if (state) {
+ // lwg 419
+ expect_state |= std::ios_base::failbit;
+ }
+ else if (white == cbuf [0] || !err_after) {
#ifndef _RWSTD_NO_EXCEPTIONS