Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 26749 invoked from network); 25 Sep 2007 18:25:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2007 18:25:22 -0000 Received: (qmail 94551 invoked by uid 500); 25 Sep 2007 18:25:06 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 94540 invoked by uid 500); 25 Sep 2007 18:25:06 -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 94495 invoked by uid 99); 25 Sep 2007 18:25:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2007 11:25:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Farid_Zaripov@epam.com designates 217.21.63.3 as permitted sender) Received: from [217.21.63.3] (HELO EPMSA009.epam.com) (217.21.63.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2007 18:27:22 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: 22.locale.money.get.cpp asserts Date: Tue, 25 Sep 2007 21:24:44 +0300 Message-ID: <7BDB2168BEAEF14C98F1901FD2DE64380100922A@epmsa009.minsk.epam.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 22.locale.money.get.cpp asserts Thread-Index: Acf/oViuwt/uePZ6SxygRiB0AD7JiQ== From: "Farid Zaripov" To: X-Virus-Checked: Checked by ClamAV on apache.org I have checked the re-asserting lines of the test and compared the results with DinkumwareSTL and STLport. The line 752: // all spaces extracted since currency symbol (last) is mandatory // verify that the facet doesn't extract too many optional spaces // leaving none for the final required currency symbol TEST (T, 103.0, "103 ", 4, showbase, eofbit, 0, "\3\4\0\2", " "); The line 798: const charT minus_space[][3] =3D { { '-', ' ', '\0' }, { '\0' } }; PunctData::negative_sign_ [intl] =3D minus_space [0]; PunctData::negative_sign_ [locl] =3D minus_space [1]; // { sign, value, none, symbol } // negative_sign is "- ", (note the single trailing space) // verify that the extraction suceeds, i.e., that the money_base::none // specifier that's last in the pattern doesn't confuse the facet into // extracting all the optional whitespace, leaving none to complete // the negative_sign TEST (T, -109.1, "-109 ", 6, 0, eofbit, 0, "\3\4\0\2", ""); The problem is in that all spaces are eaten when 'none' pattern element was parsed, but the ending currency character in first test and trailing negative_sign character in second test are requires for presence of the space character. The both test lines above are failed on DinkumwareSTL and STLport too. The questions: - may the negative_sign have the trailing part with only space characters? - may the currency symbol contain only spaces? The another lines with rw_asserts() (851 - 853): PunctData::positive_sign_ [intl] =3D 0; PunctData::positive_sign_ [locl] =3D 0; PunctData::negative_sign_ [intl] =3D 0; PunctData::negative_sign_ [locl] =3D 0; [...] TEST (T, 117.0, "117$", 4, showbase, eofbit, 0, "\4\0\2\3", "$"); TEST (T, 118.0, "118$", 4, showbase, eofbit, 0, "\4\0\2\3", "$"); TEST (T, 119.0, "119 $", 5, showbase, eofbit, 0, "\4\1\2\3", "$"); Here the sign is the last position in pattern, and positive sign and negative sign both are empty. I've prepared the patch, fixing the problem: Index: _money_get.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- _money_get.cc (revision 579104) +++ _money_get.cc (working copy) @@ -165,7 +165,10 @@ case /* '\3' */ money_base::sign: { =20 if (__it =3D=3D __end) { - __ebits |=3D _RW::__rw_failbit; + if (__ps.size () && __ns.size ()) + __ebits |=3D _RW::__rw_failbit; + else + __sign =3D __ps.empty () - 1; break; } =20 Farid.