sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS) sl@0: # include sl@0: # include sl@0: sl@0: # include "cppunit/cppunit_proxy.h" sl@0: sl@0: # if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) sl@0: using namespace std; sl@0: # endif sl@0: sl@0: // sl@0: // TestCase class sl@0: // sl@0: class CodecvtTest : public CPPUNIT_NS::TestCase sl@0: { sl@0: CPPUNIT_TEST_SUITE(CodecvtTest); sl@0: #if defined (STLPORT) && defined (_STLP_NO_MEMBER_TEMPLATES) sl@0: CPPUNIT_IGNORE; sl@0: #endif sl@0: CPPUNIT_TEST(variable_encoding); sl@0: CPPUNIT_TEST(locale_cov1); sl@0: CPPUNIT_TEST(locale_cov2); sl@0: CPPUNIT_TEST(locale_cov3); sl@0: CPPUNIT_TEST(locale_cov4); sl@0: CPPUNIT_TEST(locale_cov5); sl@0: CPPUNIT_TEST(locale_cov6); sl@0: CPPUNIT_TEST(locale_cov7); sl@0: CPPUNIT_TEST_SUITE_END(); sl@0: sl@0: protected: sl@0: void variable_encoding(); sl@0: void locale_cov1(); sl@0: void locale_cov2(); sl@0: void locale_cov3(); sl@0: void locale_cov4(); sl@0: void locale_cov5(); sl@0: void locale_cov6(); sl@0: void locale_cov7(); sl@0: }; sl@0: sl@0: CPPUNIT_TEST_SUITE_REGISTRATION(CodecvtTest); sl@0: sl@0: #if defined (STLPORT) sl@0: # define __NO_THROW _STLP_NOTHROW sl@0: #else sl@0: # define __NO_THROW throw() sl@0: #endif sl@0: sl@0: sl@0: /* Codecvt facet eating some characters from the external buffer. sl@0: * Transform '01' in 'a' sl@0: */ sl@0: struct eater_codecvt : public codecvt { sl@0: typedef codecvt base; sl@0: sl@0: explicit eater_codecvt(size_t refs = 0) : base(refs) {} sl@0: sl@0: // primitive conversion sl@0: virtual base::result sl@0: do_in(mbstate_t& mb, sl@0: const char* ebegin, const char* eend, const char*& ecur, sl@0: char* ibegin, char* iend, char*& icur) const __NO_THROW { sl@0: char *state = (char*)&mb; sl@0: ecur = ebegin; sl@0: icur = ibegin; sl@0: sl@0: while (ecur != eend) { sl@0: if (icur == iend) sl@0: return partial; sl@0: if (*ecur == '0' || *state == 1) { sl@0: if (*state != 1) { sl@0: ++ecur; sl@0: } sl@0: if (ecur == eend) { sl@0: *state = 1; sl@0: return ok; sl@0: } sl@0: sl@0: if (*ecur == '1') { sl@0: *icur = 'a'; sl@0: } sl@0: else { sl@0: *(icur++) = '0'; sl@0: if (icur == iend) { sl@0: if (*state != 1) { sl@0: --ecur; sl@0: } sl@0: return partial; sl@0: } sl@0: *icur = *ecur; sl@0: } sl@0: } sl@0: else { sl@0: *icur = *ecur; sl@0: } sl@0: sl@0: *state = 0; sl@0: ++icur; sl@0: ++ecur; sl@0: } sl@0: sl@0: return ok; sl@0: } sl@0: sl@0: // claim it's not a null-conversion sl@0: virtual bool do_always_noconv() const __NO_THROW sl@0: { return false; } sl@0: sl@0: // claim it doesn't have a fixed-length encoding sl@0: virtual int do_encoding() const __NO_THROW sl@0: { return 0; } sl@0: sl@0: // implemented for consistency with do_in overload sl@0: virtual int do_length(const mbstate_t &state, sl@0: const char *efrom, const char *eend, size_t m) const { sl@0: char *ibegin = new char[m]; sl@0: const char *ecur = efrom; sl@0: char *icur = ibegin; sl@0: mbstate_t tmp = state; sl@0: do_in(tmp, efrom, eend, ecur, ibegin, ibegin + m, icur); sl@0: delete[] ibegin; sl@0: return ecur - efrom; sl@0: } sl@0: sl@0: virtual int do_max_length() const __NO_THROW sl@0: { return 2; } sl@0: }; sl@0: sl@0: /* Codecvt facet generating more characters than the ones read from the sl@0: * external buffer, transform '01' in 'abc' sl@0: * This kind of facet do not allow systematical positionning in the external sl@0: * buffer (tellg -> -1), when you just read a 'a' you are at an undefined sl@0: * external buffer position. sl@0: */ sl@0: struct generator_codecvt : public codecvt { sl@0: typedef codecvt base; sl@0: sl@0: explicit generator_codecvt(size_t refs = 0) : base(refs) {} sl@0: sl@0: // primitive conversion sl@0: virtual base::result sl@0: do_in(mbstate_t& mb, sl@0: const char* ebegin, const char* eend, const char*& ecur, sl@0: char* ibegin, char* iend, char*& icur) const __NO_THROW { sl@0: //Access the mbstate information in a portable way: sl@0: char *state = (char*)&mb; sl@0: ecur = ebegin; sl@0: icur = ibegin; sl@0: sl@0: if (icur == iend) return ok; sl@0: sl@0: if (*state == 2) { sl@0: *(icur++) = 'b'; sl@0: if (icur == iend) { sl@0: *state = 3; sl@0: return ok; sl@0: } sl@0: *(icur++) = 'c'; sl@0: *state = 0; sl@0: } sl@0: else if (*state == 3) { sl@0: *(icur++) = 'c'; sl@0: *state = 0; sl@0: } sl@0: sl@0: while (ecur != eend) { sl@0: if (icur == iend) sl@0: return ok; sl@0: if (*ecur == '0' || *state == 1) { sl@0: if (*state != 1) { sl@0: ++ecur; sl@0: } sl@0: if (ecur == eend) { sl@0: *state = 1; sl@0: return partial; sl@0: } sl@0: sl@0: if (*ecur == '1') { sl@0: *(icur++) = 'a'; sl@0: if (icur == iend) { sl@0: *state = 2; sl@0: return ok; sl@0: } sl@0: *(icur++) = 'b'; sl@0: if (icur == iend) { sl@0: *state = 3; sl@0: return ok; sl@0: } sl@0: *icur = 'c'; sl@0: } sl@0: else { sl@0: *(icur++) = '0'; sl@0: if (icur == iend) { sl@0: if (*state != 1) { sl@0: --ecur; sl@0: } sl@0: return ok; sl@0: } sl@0: *icur = *ecur; sl@0: } sl@0: } sl@0: else { sl@0: *icur = *ecur; sl@0: } sl@0: sl@0: *state = 0; sl@0: ++icur; sl@0: ++ecur; sl@0: } sl@0: sl@0: return ok; sl@0: } sl@0: sl@0: // claim it's not a null-conversion sl@0: virtual bool do_always_noconv() const __NO_THROW sl@0: { return false; } sl@0: sl@0: // claim it doesn't have a fixed-length encoding sl@0: virtual int do_encoding() const __NO_THROW sl@0: { return 0; } sl@0: sl@0: // implemented for consistency with do_in overload sl@0: virtual int do_length(const mbstate_t &mb, sl@0: const char *efrom, const char *eend, size_t m) const { sl@0: const char *state = (const char*)&mb; sl@0: int offset = 0; sl@0: if (*state == 2) sl@0: offset = 2; sl@0: else if (*state == 3) sl@0: offset = 1; sl@0: sl@0: char *ibegin = new char[m + offset]; sl@0: const char *ecur = efrom; sl@0: char *icur = ibegin; sl@0: mbstate_t tmpState = mb; sl@0: do_in(tmpState, efrom, eend, ecur, ibegin, ibegin + m + offset, icur); sl@0: /* sl@0: char *state = (char*)&tmpState; sl@0: if (*state != 0) { sl@0: if (*state == 1) sl@0: --ecur; sl@0: else if (*state == 2 || *state == 3) { sl@0: //Undefined position, we return -1: sl@0: ecur = efrom - 1; sl@0: } sl@0: } sl@0: else { sl@0: if (*((char*)&mb) != 0) { sl@0: //We take into account the character that hasn't been counted yet in sl@0: //the previous decoding step: sl@0: ecur++; sl@0: } sl@0: } sl@0: */ sl@0: delete[] ibegin; sl@0: return (int)min((size_t)(ecur - efrom), m); sl@0: } sl@0: sl@0: virtual int do_max_length() const __NO_THROW sl@0: { return 0; } sl@0: }; sl@0: sl@0: // sl@0: // tests implementation sl@0: // sl@0: void CodecvtTest::variable_encoding() sl@0: { sl@0: #if !defined (STLPORT) || !defined (_STLP_NO_MEMBER_TEMPLATES) sl@0: //We first generate the file used for test: sl@0: const char* fileName = "c:\\test_file.txt"; sl@0: { sl@0: ofstream ostr(fileName); sl@0: //Maybe we simply do not have write access to repository sl@0: CPPUNIT_ASSERT( ostr.good() ); sl@0: for (int i = 0; i < 2048; ++i) { sl@0: ostr << "0123456789"; sl@0: } sl@0: CPPUNIT_ASSERT( ostr.good() ); sl@0: } sl@0: sl@0: { sl@0: ifstream istr(fileName); sl@0: CPPUNIT_ASSERT( istr.good() ); sl@0: CPPUNIT_ASSERT( !istr.eof() ); sl@0: sl@0: eater_codecvt codec(1); sl@0: locale loc(locale::classic(), &codec); sl@0: sl@0: istr.imbue(loc); sl@0: CPPUNIT_ASSERT( istr.good() ); sl@0: CPPUNIT_ASSERT( (int)istr.tellg() == 0 ); sl@0: sl@0: int theoricalPos = 0; sl@0: do { sl@0: signed char c = (signed char)istr.get(); sl@0: if (c == char_traits::eof()) { sl@0: break; sl@0: } sl@0: ++theoricalPos; sl@0: if (c == 'a') { sl@0: ++theoricalPos; sl@0: } sl@0: CPPUNIT_ASSERT( (int)istr.tellg() == theoricalPos ); sl@0: } sl@0: while (!istr.eof()); sl@0: sl@0: CPPUNIT_ASSERT( istr.eof() ); sl@0: } sl@0: sl@0: # if 0 sl@0: /* This test is broken, not sure if it is really possible to get a position in sl@0: * a locale having a codecvt such as generator_codecvt. Maybe generator_codecvt sl@0: * is not a valid theorical example of codecvt implementation. */ sl@0: { sl@0: ifstream istr(fileName); sl@0: CPPUNIT_ASSERT( istr.good() ); sl@0: CPPUNIT_ASSERT( !istr.eof() ); sl@0: sl@0: generator_codecvt codec(1); sl@0: locale loc(locale::classic(), &codec); sl@0: sl@0: istr.imbue(loc); sl@0: CPPUNIT_ASSERT( istr.good() ); sl@0: CPPUNIT_ASSERT( (int)istr.tellg() == 0 ); sl@0: sl@0: int theoricalPos = 0; sl@0: int theoricalTellg; sl@0: do { sl@0: char c = istr.get(); sl@0: if (c == char_traits::eof()) { sl@0: break; sl@0: } sl@0: switch (c) { sl@0: case 'a': sl@0: case 'b': sl@0: theoricalTellg = -1; sl@0: break; sl@0: case 'c': sl@0: ++theoricalPos; sl@0: default: sl@0: ++theoricalPos; sl@0: theoricalTellg = theoricalPos; sl@0: break; sl@0: } sl@0: sl@0: if ((int)istr.tellg() != theoricalTellg) { sl@0: CPPUNIT_ASSERT( (int)istr.tellg() == theoricalTellg ); sl@0: } sl@0: } sl@0: while (!istr.eof()); sl@0: sl@0: CPPUNIT_ASSERT( istr.eof() ); sl@0: } sl@0: # endif sl@0: #endif sl@0: } sl@0: sl@0: void CodecvtTest::locale_cov1() sl@0: { sl@0: locale loc ( "fr_FR.ISO-8859-1" ); sl@0: locale loc1 ( "en_US.ISO-8859-1" ); sl@0: bool result1,result2; sl@0: { sl@0: result1 = isalnum ( 'L', loc); sl@0: result2 = isalnum ( '@', loc); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false); sl@0: sl@0: result1 = isalnum ( 'L', loc1); sl@0: result2 = isalnum ( '@', loc1); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false); sl@0: } sl@0: { sl@0: result1 = isalpha ( 'L', loc); sl@0: result2 = isalpha ( '@', loc); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false); sl@0: sl@0: result1 = isalpha ( 'L', loc1); sl@0: result2 = isalpha ( '@', loc1); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false); sl@0: } sl@0: { sl@0: result1 = iscntrl ( 'L', loc); sl@0: result2 = iscntrl ( '\n', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = iscntrl ( 'L', loc1); sl@0: result2 = iscntrl ( '\n', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: { sl@0: result1 = isdigit ( 'L', loc); sl@0: result2 = isdigit ( '3', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = isdigit ( 'L', loc1); sl@0: result2 = isdigit ( '3', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov2() sl@0: { sl@0: locale loc ( "fr_FR.ISO-8859-1" ); sl@0: locale loc1 ( "en_US.ISO-8859-1" ); sl@0: bool result1,result2; sl@0: { sl@0: result1 = isgraph ( ' ', loc); sl@0: result2 = isgraph ( '.', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = isgraph ( ' ', loc1); sl@0: result2 = isgraph ( '.', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: { sl@0: result1 = islower ( 'L', loc); sl@0: result2 = islower ( 'v', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = islower ( 'L', loc1); sl@0: result2 = islower ( 'v', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: { sl@0: result1 = isprint ( '\n', loc); sl@0: result2 = isprint ( 't', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = isprint ( '\n', loc1); sl@0: result2 = isprint ( 't', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: { sl@0: result1 = ispunct ( 'L', loc); sl@0: result2 = ispunct ( ';', loc); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: sl@0: result1 = ispunct ( 'L', loc1); sl@0: result2 = ispunct ( ';', loc1); sl@0: CPPUNIT_ASSERT( result1 == false); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov3() sl@0: { sl@0: locale loc ( "fr_FR.ISO-8859-1" ); sl@0: locale loc1 ( "en_US.ISO-8859-1" ); sl@0: bool result1,result2,result3; sl@0: { sl@0: result2 = isspace ( '\n', loc); sl@0: result3 = isspace ( 'x', loc); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: CPPUNIT_ASSERT( result3 == false ); sl@0: sl@0: result2 = isspace ( '\n', loc1); sl@0: result3 = isspace ( 'x', loc1); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: CPPUNIT_ASSERT( result3 == false ); sl@0: } sl@0: { sl@0: result1 = isupper ( 'L', loc); sl@0: result2 = isupper ( ';', loc); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false ); sl@0: sl@0: result1 = isupper ( 'L', loc1); sl@0: result2 = isupper ( ';', loc1); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == false ); sl@0: } sl@0: { sl@0: result1 = isxdigit ( 'f', loc); sl@0: result2 = isxdigit ( 'd', loc); sl@0: result3 = isxdigit ( 'q', loc); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: CPPUNIT_ASSERT( result3 == false ); sl@0: sl@0: result1 = isxdigit ( 'f', loc1); sl@0: result2 = isxdigit ( 'd', loc1); sl@0: result3 = isxdigit ( 'q', loc1); sl@0: CPPUNIT_ASSERT( result1 == true ); sl@0: CPPUNIT_ASSERT( result2 == true ); sl@0: CPPUNIT_ASSERT( result3 == false ); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov4() sl@0: { sl@0: locale loc ( "fr_FR.ISO-8859-1" ); sl@0: locale loc1 ( "en_US.ISO-8859-1" ); sl@0: char cresult1; sl@0: { sl@0: cresult1 = tolower ( 'H', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == 'h' ); sl@0: cresult1 = tolower ( 'h', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == 'h' ); sl@0: cresult1 = tolower ( '$', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == '$' ); sl@0: sl@0: cresult1 = tolower ( 'H', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == 'h' ); sl@0: cresult1 = tolower ( 'h', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == 'h' ); sl@0: cresult1 = tolower ( '$', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == '$' ); sl@0: } sl@0: { sl@0: cresult1 = toupper ( 'H', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == 'H' ); sl@0: cresult1 = toupper ( 'h', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == 'H' ); sl@0: cresult1 = toupper ( '$', loc ); sl@0: CPPUNIT_ASSERT( cresult1 == '$' ); sl@0: sl@0: cresult1 = toupper ( 'H', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == 'H' ); sl@0: cresult1 = toupper ( 'h', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == 'H' ); sl@0: cresult1 = toupper ( '$', loc1 ); sl@0: CPPUNIT_ASSERT( cresult1 == '$' ); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov5() sl@0: { sl@0: { sl@0: char* str = "stdcpp with pips"; sl@0: mbstate_t state = {0}; sl@0: locale loc("C"); sl@0: int res = use_facet > ( loc ).length( state,str, &str[strlen(str)], 50 ); sl@0: CPPUNIT_ASSERT( res == 16 ); sl@0: res = use_facet >( loc ).max_length( ); sl@0: } sl@0: { sl@0: char* str = "stdcpp with pips"; sl@0: wchar_t wstr [50]; sl@0: memset(&wstr[0], 0, (sizeof(wchar_t))*(50)); sl@0: const char* pszNext; sl@0: wchar_t* pwszNext; sl@0: mbstate_t state = {0}; sl@0: locale loc("C"); sl@0: int res = use_facet >( loc ).in( state,str, &str[strlen(str)], pszNext,wstr, &wstr[strlen(str)], pwszNext ); sl@0: wstr[strlen(str)] = 0; sl@0: CPPUNIT_ASSERT(res!=codecvt_base::error); sl@0: } sl@0: { sl@0: locale loc ( "fr_FR.ISO-8859-1" ); sl@0: int result1 = use_facet > ( loc ).encoding ( ); sl@0: CPPUNIT_ASSERT(result1 == 1); sl@0: bool result2 = use_facet >( loc ).always_noconv( ); sl@0: CPPUNIT_ASSERT(result2 == true); sl@0: result2 = use_facet >( loc ).always_noconv( ); sl@0: CPPUNIT_ASSERT(result2 == false); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov6() sl@0: { sl@0: { sl@0: locale loc( "en_US.ISO-8859-1" ); sl@0: const numpunct < char> &npunct = use_facet >( loc ); sl@0: string str = npunct.truename(); sl@0: CPPUNIT_ASSERT(str == "true"); sl@0: str = npunct.falsename(); sl@0: CPPUNIT_ASSERT(str == "false"); sl@0: CPPUNIT_ASSERT(npunct.thousands_sep( ) == ','); sl@0: sl@0: const numpunct < wchar_t> &npunct1 = use_facet >( loc ); sl@0: wstring str1 = npunct1.truename(); sl@0: CPPUNIT_ASSERT(str1 == L"true"); sl@0: str1 = npunct1.falsename(); sl@0: CPPUNIT_ASSERT(str1 == L"false"); sl@0: CPPUNIT_ASSERT(npunct1.thousands_sep( ) == L','); sl@0: CPPUNIT_ASSERT(npunct1.decimal_point( ) == L'.'); sl@0: } sl@0: } sl@0: void CodecvtTest::locale_cov7() sl@0: { sl@0: { sl@0: locale loc( "en_US.ISO-8859-1" ); sl@0: const moneypunct &mpunct = use_facet >(loc); sl@0: CPPUNIT_ASSERT(mpunct.thousands_sep( ) == ','); sl@0: string str = mpunct.positive_sign( ); sl@0: str = mpunct.negative_sign( ); sl@0: char x = mpunct.neg_format().field[0]; sl@0: x = mpunct.neg_format().field[1]; sl@0: x = mpunct.neg_format().field[2]; sl@0: x = mpunct.neg_format().field[3]; sl@0: CPPUNIT_ASSERT(mpunct.decimal_point( ) == '.'); sl@0: str = mpunct.curr_symbol( ); sl@0: sl@0: const moneypunct &mpunct2 = use_facet >(loc); sl@0: CPPUNIT_ASSERT(mpunct2.thousands_sep( ) == ','); sl@0: str = mpunct2.positive_sign( ); sl@0: str = mpunct2.negative_sign( ); sl@0: x = mpunct2.neg_format().field[0]; sl@0: x = mpunct2.neg_format().field[1]; sl@0: x = mpunct2.neg_format().field[2]; sl@0: x = mpunct2.neg_format().field[3]; sl@0: CPPUNIT_ASSERT(mpunct2.decimal_point( ) == '.'); sl@0: str = mpunct2.curr_symbol( ); sl@0: } sl@0: } sl@0: #endif