Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 37155 invoked from network); 12 Jul 2006 00:39:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Jul 2006 00:39:09 -0000 Received: (qmail 19804 invoked by uid 500); 12 Jul 2006 00:39:09 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 19795 invoked by uid 500); 12 Jul 2006 00:39:09 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 19779 invoked by uid 99); 12 Jul 2006 00:39:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 17:39:08 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 17:39:07 -0700 Received: from qxvcexch01.ad.quovadx.com (qxvcexch01.ad.quovadx.com [192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.4) with ESMTP id k6C0chmP000557 for ; Wed, 12 Jul 2006 00:38:43 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Jul 2006 18:38:48 -0600 Message-ID: <44B444AE.20603@roguewave.com> Date: Tue, 11 Jul 2006 18:39:10 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: test for lib.string.io References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Jul 2006 00:38:48.0839 (UTC) FILETIME=[8A51E170:01C6A54B] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Farid Zaripov wrote: >>-----Original Message----- >>From: Martin Sebor [mailto:sebor@roguewave.com] >>Sent: Friday, June 30, 2006 1:25 AM >>To: stdcxx-dev@incubator.apache.org >>Subject: Re: test for lib.string.io > > >>Thanks for pointing it out! I think I might go ahead and >>commit these changes sometime over the weekend. > > > Martin, the 21.string.io test still generates rw_asserts due to opened > issues 205 and 206. > > What about these issues? I committed the patch below. While the new code is guarded with a config macro (which is not #defined unless extensions are turned off) I'm beginning to think we might as well enable the new code unconditionally since the behavior currently required by the standard is quite inconsistent (see below). http://svn.apache.org/viewvc?rev=420970&view=rev With the patch applied I get 120 failed assertions out of the io test, all of them on lines 872 through 886. They all look like they are due to the test expecting failbit for insertions into the stream buffer that fail and the library setting badbit. I think the library does the right thing and the standard needs to be fixed to say that operator<<(ostream&, string) a) is a Formatted Output Function and b) should behave according to the requirements on such functions and thus should set badbit and not failbit when it fails to produce the expected output. Martin Functions that are required to set badbit: ios::iword(int): on failure ios::pword(int): on failure ios::clear(iostate): rdbuf() == 0 Formatted/Unformatted Input Functions: on exception from streambuf Formatted/Unformatted Output Functions: on exception from streambuf U istream::putback(char): rdbuf()->sputbackc() returns EOF U istream::unget(): rdbuf()->sungetc() returns EOF U istream::sync(): rdbuf()->sync() returns -1 F ostream::operator<<(arithmetic and void*): iterator.failed() is true F ostream::operator<<(streambuf *sb): sb == 0 U ostream::put(char): on failure to insert U ostream::write(const char*, streamsize): on failure to insert ostream::flush(): rdbuf()->pubsync() returns -1 Functions that are required to set failbit: operator>>(istream&, string&): extracts 0 chars operator<<(ostream&, string): xrdbuf()->sputn() fails U getline(istream&, string&): stores max_size() chars or extracts 0 chars xxx_get::get(): parse error or bad grouping F operator>>(istream&, bitset&): stores 0 chars operator>>(istream&, complex&): "bad input" istream::sentry(istream&): sgetc/sbumpc() returns EOF or stream not good F istream::operator>>(short &val): out of range val F istream::operator>>(int &val): out of range val F istream::operator>>(charT*): extracts no chars F istream::operator>>(charT&): extracts no chars F istream::operator>>(streambuf *sb): sb == 0 or extracts no chars U istream::get(): extracts no chars U istream::get(char&): extracts no chars U istream::get(char*, streamsize): stores no chars U istream::get(streambuf &sb): inserts no chars to sb U istream::getline(char*, streamsize n): extracts 0 or stores (n - 1) chars U istream::read(char*, streamsize): !good() or reaches EOF U istream::readsome(char*, streamsize): !good() U istream::putback(char): !good() U istream::unget(): !good() U istream::seekg(pos_type): on failure ostream::sentry::sentry(ostream&): any reason U ostream::seekp(pos_type): on failure Formatted Output Functions: on failure to generate output F ostream::operator<<(streambuf*): inserts no chars or exception during input ifstream::ifstream(const char*): rdbuf()->open() returns 0 ifstream::open(const char*): rdbuf()->open() returns 0 ifstream::close(): rdbuf()->close() returns false ofstream::ofstream(const char*): rdbuf()->open() returns 0 ofstream::open(const char*): rdbuf()->open() returns 0 ofstream::close(): rdbuf()->close() returns false fstream::fstream(const char*): rdbuf()->open() returns 0 fstream::open(const char*): rdbuf()->open() returns 0 fstream::close(): rdbuf()->close() returns false F: Formatted I/O Functions U: Unformatted I/O Functions