Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 #include <StifParser.h>
23 #include <Stiftestinterface.h>
29 #define STDCPP_OOM FALSE
30 #define testChar unsigned char
33 // ============================ MEMBER FUNCTIONS ===============================
35 // -----------------------------------------------------------------------------
37 // Delete here all resources allocated and opened from test methods.
38 // Called from destructor.
39 // -----------------------------------------------------------------------------
41 void Ctlocale::Delete()
49 // -----------------------------------------------------------------------------
50 // Ctlocale::RunMethodL
51 // Run specified method. Contains also table of test mothods and their names.
52 // -----------------------------------------------------------------------------
54 TInt Ctlocale::RunMethodL(
55 CStifItemParser& aItem )
58 static TStifFunctionInfo const KFunctions[] =
60 // Copy this line for every implemented function.
61 // First string is the function name used in TestScripter script file.
62 // Second is the actual implementation member function.
63 ENTRY( "hasfacet", Ctlocale::hasfacet ),
64 ENTRY( "usefacet", Ctlocale::usefacet ),
65 ENTRY( "numget", Ctlocale::numget ),
66 ENTRY( "numput", Ctlocale::numput ),
67 ENTRY( "num_punct", Ctlocale::num_punct ),
68 ENTRY( "numpunctbyname", Ctlocale::numpunctbyname ),
69 ENTRY( "moneyget", Ctlocale::moneyget ),
70 ENTRY( "moneyput", Ctlocale::moneyput ),
71 ENTRY( "money_punct", Ctlocale::money_punct ),
72 ENTRY( "moneypunctbyname", Ctlocale::moneypunctbyname ),
73 ENTRY( "timeget", Ctlocale::timeget ),
74 ENTRY( "timeput", Ctlocale::timeput ),
75 ENTRY( "messagesL", Ctlocale::messagesL ),
76 ENTRY( "messagesbyname", Ctlocale::messagesbyname ),
77 ENTRY( "collateL", Ctlocale::collateL ),
78 ENTRY( "collatebyname", Ctlocale::collatebyname ),
79 ENTRY( "codecvt1", Ctlocale::codecvt1 ),
80 ENTRY( "codecvt2", Ctlocale::codecvt2 ),
81 ENTRY( "codecvtbyname1", Ctlocale::codecvtbyname1 ),
82 ENTRY( "codecvtbyname2", Ctlocale::codecvtbyname2 ),
84 ENTRY( "ctype_byname1", Ctlocale::ctype_byname1L),
85 ENTRY( "moneypunct_byname1", Ctlocale::moneypunct_byname1L),
86 ENTRY( "moneypunct1", Ctlocale::moneypunct1L),
87 ENTRY( "numpunct1", Ctlocale::numpunct1L),
88 ENTRY( "numpunct_byname1", Ctlocale::numpunct_byname1L),
91 const TInt count = sizeof( KFunctions ) /
92 sizeof( TStifFunctionInfo );
94 return RunInternalL( KFunctions, count, aItem );
99 // -----------------------------------------------------------------------------
100 // Ctlocale::has_facet
101 // has_facet test method function.
103 // -----------------------------------------------------------------------------
107 TInt Ctlocale::hasfacet( CStifItemParser& aItem )
121 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
125 locale loc("en_GB.UTF-8") ;
126 result = has_facet <ctype<char> > ( loc );
128 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
160 // -----------------------------------------------------------------------------
161 // Ctlocale::use_facet
162 // use_facet test method function.
164 // -----------------------------------------------------------------------------
168 TInt Ctlocale::usefacet( CStifItemParser& aItem )
176 locale loc ("en_GB.UTF-8");
179 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
181 bool result = use_facet<ctype<char> > ( loc ).is(ctype_base::alpha, 'b');
183 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
215 // -----------------------------------------------------------------------------
217 // num_get test method function.
219 // -----------------------------------------------------------------------------
223 TInt Ctlocale::numget( CStifItemParser& aItem )
231 typedef istreambuf_iterator<char,char_traits<char> >
240 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
242 const num_get<char,iter_type>& tg = use_facet<num_get<char,iter_type> >(loc);
245 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
266 // -----------------------------------------------------------------------------
268 // num_put test method function.
270 // -----------------------------------------------------------------------------
272 TInt Ctlocale::numput( CStifItemParser& aItem )
280 typedef ostreambuf_iterator<char,char_traits<char> >
286 // Construct a ostreambuf_iterator on cout
287 iter_type begin(cout);
289 // Get a num_put facet reference
292 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
294 const num_put<char,iter_type>& np = use_facet<num_put<char,iter_type> >(loc);
296 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
319 // -----------------------------------------------------------------------------
320 // Ctlocale::num_punct
321 // num_punct test method function.
323 // -----------------------------------------------------------------------------
325 TInt Ctlocale::num_punct( CStifItemParser& aItem )
336 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
338 const numpunct <char> &npunct = use_facet <numpunct <char> >( loc);
339 // const numpunct <unsigned> &n1punct = use_facet <numpunct <unsigned> >( loc);
341 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
344 if(npunct.truename() == "true")
345 if(npunct.falsename()=="false")
346 if(npunct.decimal_point() =='.')
347 if(npunct.thousands_sep() ==',')
353 return KErrGeneral;*/
354 if(npunct.truename() != "true")
356 if(npunct.falsename()!="false")
358 if(npunct.decimal_point() !='.')
360 if(npunct.thousands_sep() !=',')
380 // -----------------------------------------------------------------------------
381 // Ctlocale::numpunct_byname
382 // numpunct_byname test method function.
384 // -----------------------------------------------------------------------------
386 TInt Ctlocale::numpunctbyname( CStifItemParser& aItem )
397 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
399 const numpunct_byname <char> &npunct = use_facet <numpunct_byname <char> >( loc);
401 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
404 /*if(npunct.truename() == "true")
405 if(npunct.falsename()=="false")
406 if(npunct.decimal_point( ) =='.')
407 if(npunct.thousands_sep( ) ==',')
413 return KErrGeneral;*/
415 if(npunct.truename() != "true")
417 if(npunct.falsename()!="false")
419 if(npunct.decimal_point( ) !='.')
421 if(npunct.thousands_sep( ) !=',')
441 // -----------------------------------------------------------------------------
442 // Ctlocale::money_get
443 // money_get test method function.
445 // -----------------------------------------------------------------------------
448 TInt Ctlocale::moneyget( CStifItemParser& aItem )
456 typedef istreambuf_iterator<char,char_traits<char> >
460 string buffer("$100.02");
463 ios_base::iostate state;
467 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
469 // Get a money_get facet
470 const money_get<char,iter_type>& mgf = use_facet<money_get<char,iter_type> >(loc);
473 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
495 // -----------------------------------------------------------------------------
496 // Ctlocale::money_put
497 // money_put test method function.
499 // -----------------------------------------------------------------------------
501 TInt Ctlocale::moneyput( CStifItemParser& aItem )
509 typedef ostreambuf_iterator<char,char_traits<char> >
513 string buffer("10002");
514 long double ldval = 10002;
516 iter_type begin(cout);
519 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
521 const money_put<char,iter_type>& mp = use_facet<money_put<char,iter_type> >(loc);
524 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
548 // -----------------------------------------------------------------------------
549 // Ctlocale::moneypunct
550 // moneypunct test method function.
552 // -----------------------------------------------------------------------------
554 TInt Ctlocale::money_punct( CStifItemParser& aItem )
566 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
568 const moneypunct<char,false>& mp =
569 use_facet<moneypunct<char,false> >(loc);
571 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
576 /* if(mp.decimal_point() == '.')
577 if(mp.thousands_sep() == ',')
578 if( mp.frac_digits() == 0)
585 return KErrGeneral;*/
587 if(mp.decimal_point() != '.')
589 if(mp.thousands_sep() != ',')
591 if( mp.frac_digits() != 0)
614 // -----------------------------------------------------------------------------
615 // Ctlocale::moneypunct_byname
616 // moneypunct_byname test method function.
618 // -----------------------------------------------------------------------------
621 TInt Ctlocale::moneypunctbyname( CStifItemParser& aItem )
634 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
636 const moneypunct_byname<char,false>& mp =
638 use_facet<moneypunct_byname<char,false> >(loc);
642 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
647 if(mp.decimal_point() != '.')
649 if(mp.thousands_sep() != ',')
651 if( mp.frac_digits() != 0)
675 // -----------------------------------------------------------------------------
676 // Ctlocale::time_get
677 // time_get test method function.
679 // -----------------------------------------------------------------------------
683 TInt Ctlocale::timeget( CStifItemParser& aItem )
691 typedef std::istreambuf_iterator<char,
692 std::char_traits<char> > Iter;
693 static struct tm timeb;
694 std::ios_base::iostate state;
697 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
699 const std::time_get<char, Iter> &tg =
700 std::use_facet<std::time_get<char, Iter> >(std::locale ("C"));
702 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
724 // -----------------------------------------------------------------------------
725 // Ctlocale::time_put
726 // time_put test method function.
728 // -----------------------------------------------------------------------------
730 TInt Ctlocale::timeput( CStifItemParser& aItem )
738 std::tm t = std::tm ();
751 const char* const fmt[] = {
752 "%a", "%A", "%b", "%B", "%c", "%C", "%d", "%D",
753 "%e", "%F", "%g", "%G", "%h", "%H", "%I", "%j",
754 "%k", "%l", "%m", "%M", "%n", "%p", "%r", "%R",
755 "%S", "%t", "%T", "%u", "%U", "%V", "%w", "%W", "%x",
756 "%X", "%y", "%Y", "%z", "%Z", "%%", "%Ec", "%EC", "%Ex",
757 "%EX", "%Ey", "%EY", "%Od", "%Oe", "%OH", "%OI", "%Om",
758 "%OM", "%OS", "%Ou", "%OU", "%OV", "%Ow", "%OW", "%Oy"
762 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
764 const std::time_put<char> &tput =
765 std::use_facet<std::time_put<char> >(std::cout.getloc ());
768 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
791 // -----------------------------------------------------------------------------
792 // Ctlocale::messages
793 // messages test method function.
795 // -----------------------------------------------------------------------------
798 TInt Ctlocale::messagesL( CStifItemParser& aItem )
809 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
811 const messages<char>& mess =use_facet<messages<char> >(loc);
813 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
815 // no support to .cat files
818 string def("Message Not Found");
819 messages<char>::catalog cat =
820 mess.open("./rwstdmessages.cat",loc);
823 string msg0 = mess.get(cat,1,1,def);
824 string msg1 = mess.get(cat,1,2,def);
825 string msg2 = mess.get(cat,1,6,def); // invalid msg #
826 string msg3 = mess.get(cat,2,1,def);
829 cout << msg0 << endl << msg1 << endl
830 << msg2 << endl << msg3 << endl;
833 cout << "Unable to open message catalog" << endl;*/
856 // -----------------------------------------------------------------------------
857 // Ctlocale::messages_byname
858 // messages_byname test method function.
860 // -----------------------------------------------------------------------------
862 TInt Ctlocale::messagesbyname( CStifItemParser& aItem )
873 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
875 const messages_byname<char>& mess =
877 use_facet<messages_byname<char> >(loc);
879 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
882 // no support to .cat files
884 string def("Message Not Found");
885 messages_byname<char>::catalog cat =
886 mess.open("./rwstdmessages.cat",loc);
889 string msg0 = mess.get(cat,1,1,def);
890 string msg1 = mess.get(cat,1,2,def);
891 string msg2 = mess.get(cat,1,6,def); // invalid msg #
892 string msg3 = mess.get(cat,2,1,def);
895 cout << msg0 << endl << msg1 << endl
896 << msg2 << endl << msg3 << endl;
899 cout << "Unable to open message catalog" << endl;*/
920 // -----------------------------------------------------------------------------
922 // collate test method function.
924 // -----------------------------------------------------------------------------
926 TInt Ctlocale::collateL( CStifItemParser& aItem )
938 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
940 const collate<char>& co =
941 use_facet<collate<char> >(loc);
943 if( co.compare(s1.begin(),s1.end(),s2.begin(),s2.end()-1) != 0)
946 if( co.compare(s1.begin(),s1.end(), s2.begin(),s2.end()) != -1)
949 // Retrieve hash values for two strings
950 if( co.hash(s1.begin(),s1.end())!= 15636)
953 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
976 // -----------------------------------------------------------------------------
977 // Ctlocale::collatebyname
978 // collatebyname test method function.
980 // -----------------------------------------------------------------------------
982 TInt Ctlocale::collatebyname( CStifItemParser& aItem )
994 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
996 const collate_byname<char>& co = use_facet<collate_byname<char> >(loc);
998 if( co.compare(s1.begin(),s1.end(),s2.begin(),s2.end()-1) != 0)
1001 if( co.compare(s1.begin(),s1.end(), s2.begin(),s2.end()) != -1)
1004 // Retrieve hash values for two strings
1005 if( co.hash(s1.begin(),s1.end())!= 15636)
1008 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1035 // -----------------------------------------------------------------------------
1036 // Ctlocale::codecvt1
1037 // codecvt1 test method function.
1039 // -----------------------------------------------------------------------------
1042 TInt Ctlocale::codecvt1( CStifItemParser& aItem )
1046 locale loc ( "de_DE.ISO-8859-1" );
1052 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1054 int result = use_facet<codecvt<char, char, mbstate_t> > ( loc ).encoding ();
1061 char* str = "This is the string whose length is to be measured!";
1062 mbstate_t state = {0};
1063 locale loc1("C");//English_Britain");//German_Germany
1064 //int res = use_facet<codecvt<wchar_t, char, mbstate_t>>( loc ).length( state,str, &str[strlen(str)], 90 );
1067 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1068 ( loc1 ).length( state,str, &str[strlen(str)], 90 );
1077 locale loc2( "C");//English_Britain" );//German_Germany
1078 int res2 = use_facet<codecvt<char, char, mbstate_t> >
1079 ( loc ).max_length( );
1085 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1107 // -----------------------------------------------------------------------------
1108 // Ctlocale::codecvt2
1109 // codecvt2 test method function.
1111 // -----------------------------------------------------------------------------
1113 TInt Ctlocale::codecvt2( CStifItemParser& aItem )
1121 wchar_t *strin = L"This is the wchar_t string to be converted.";
1122 memset( &strout[0], 0, ( sizeof( char ) )*( 91 ) );
1124 const wchar_t* pwszNext;
1129 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1131 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1132 ( loc ).out( state,strin, &strin[wcslen( strin )], pwszNext ,
1133 strout, &strout[wcslen( strin )], strnext );
1135 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1137 strout[wcslen( strin )] = 0;
1139 string str = "This is the wchar_t string to be converted.";
1141 /*if(str.compare(&strout[0]) == 0)
1148 if(str.compare(&strout[0]) != 0)
1172 // -----------------------------------------------------------------------------
1173 // Ctlocale::codecvtbyname1
1174 // codecvtbyname1 test method function.
1176 // -----------------------------------------------------------------------------
1179 TInt Ctlocale::codecvtbyname1( CStifItemParser& aItem )
1183 locale loc ( "de_DE.ISO-8859-1" );
1189 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1191 int result = use_facet<codecvt_byname<char, char, mbstate_t> > ( loc ).encoding ();
1193 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1199 char* str = "This is the string whose length is to be measured!";
1200 mbstate_t state = {0};
1204 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1206 int res = use_facet<codecvt_byname<wchar_t, char, mbstate_t> >
1207 ( loc1 ).length( state,str, &str[strlen(str)], 90 );
1210 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1220 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1222 int res2 = use_facet<codecvt_byname<char, char, mbstate_t> >( loc ).max_length( );
1224 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1250 // -----------------------------------------------------------------------------
1251 // Ctlocale::codecvtbyname2
1252 // codecvtbyname2 test method function.
1254 // -----------------------------------------------------------------------------
1256 TInt Ctlocale::codecvtbyname2( CStifItemParser& aItem )
1263 char* strout = "This is the string to be converted!";
1265 memset(&strin[0], 0, (sizeof(wchar_t))*(91));
1266 const char* pszNext;
1268 mbstate_t state = {0};
1272 User::__DbgSetAllocFail(FALSE,RHeap::EDeterministic,1);
1274 int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
1275 ( loc ).in( state, strout, &strout[strlen(strout)], pszNext,
1276 strin, &strin[strlen(strout)], pwszNext );
1278 User::__DbgSetAllocFail(FALSE,RHeap::ENone,1);
1280 strin[strlen(strout)] = 0;
1282 wstring str = L"This is the string to be converted!";
1285 if(str.compare(&strin[0]) == 0)
1291 if(str.compare(&strin[0]) != 0)
1316 template<class _CharT>
1317 void Convert_string2_string_chart(basic_string<_CharT> &dst, string src)
1319 int length = src.length();
1320 const char* str = src.c_str();
1321 for(int i = 0; i<length;i++)
1323 dst.append(1, (_CharT)*str++);
1331 // -----------------------------------------------------------------------------
1332 // Ctlocale::ctype_byname_test1L
1333 // -----------------------------------------------------------------------------
1335 struct MyCtype_bybname : public ctype_byname<testChar> {
1336 MyCtype_bybname(const char *name, size_t refs)
1337 : ctype_byname<testChar>(name, refs) {}
1338 testChar my_do_toupper(testChar ch) const
1339 {return (this->do_toupper(ch)); }
1340 const testChar *my_do_toupper(testChar *first,
1341 const testChar *last) const
1342 {return (this->do_toupper(first, last)); }
1343 testChar my_do_tolower(testChar ch) const
1344 {return (this->do_tolower(ch)); }
1345 const testChar *my_do_tolower(testChar *first,
1346 const testChar *last) const
1347 {return (this->do_tolower(first, last)); }
1349 // -----------------------------------------------------------------------------
1350 // Ctlocale::ExampleL
1351 // Example test method function.
1352 // (other items were commented in a header).
1353 // -----------------------------------------------------------------------------
1356 TInt Ctlocale::ctype_byname1L( CStifItemParser& aItem )
1360 _LIT( Ktlocale, "tlocale" );
1361 _LIT( Ktest1, "In Test1" );
1362 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1363 // Print to log file
1364 iLog->Log( Ktest1 );
1368 _LIT( KParam, "Param[%i]: %S" );
1370 MyCtype_bybname fac("C", 1);
1372 if (fac.my_do_toupper('a') != 'A')
1375 testChar a[] = {"ABc0D"};
1376 fac.my_do_tolower(a, a + 2);
1377 if (strcmp((const char *)a, "abc0D") != 0)
1386 // -----------------------------------------------------------------------------
1387 // Ctlocale::moneypunct_byname_test3L
1388 // -----------------------------------------------------------------------------
1390 struct Mympunct_byname : public moneypunct_byname<testChar, true> {
1391 Mympunct_byname(const char *name, size_t refs)
1392 : moneypunct_byname<testChar, true>(name, refs) {}
1393 testChar my_do_decimal_point() const
1394 {return (do_decimal_point()); }
1397 TInt Ctlocale::moneypunct_byname1L( CStifItemParser& aItem )
1402 _LIT( Ktlocale, "tlocale" );
1403 _LIT( Ktest1, "In Test3" );
1404 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1405 // Print to log file
1406 iLog->Log( Ktest1 );
1410 _LIT( KParam, "Param[%i]: %S" );
1412 Mympunct_byname fac("C", 1);
1413 testChar ch = fac.my_do_decimal_point();
1420 // -----------------------------------------------------------------------------
1421 // Ctlocale::moneypunct_test2L
1422 // -----------------------------------------------------------------------------
1424 struct Mymoneypunct : public moneypunct<testChar, true> {
1425 string_type my_do_positive_sign() const
1426 {return (do_positive_sign()); }
1429 TInt Ctlocale::moneypunct1L( CStifItemParser& aItem )
1433 _LIT( Ktlocale, "tlocale" );
1434 _LIT( Ktest1, "In Test2" );
1435 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1436 // Print to log file
1437 iLog->Log( Ktest1 );
1441 _LIT( KParam, "Param[%i]: %S" );
1444 basic_string<testChar> str = fac.my_do_positive_sign();
1453 // -----------------------------------------------------------------------------
1454 // Ctlocale::numpunct_test4L
1455 // -----------------------------------------------------------------------------
1458 struct Mynumpunct : public numpunct<testChar> {
1460 basic_string<testChar> do_truename() const
1461 { basic_string<testChar> str1;
1462 Convert_string2_string_chart(str1,"!");
1464 basic_string<testChar> do_falsename() const
1466 basic_string<testChar> str1;
1467 Convert_string2_string_chart(str1,"!!");
1471 TInt Ctlocale::numpunct1L( CStifItemParser& aItem )
1475 _LIT( Ktlocale, "tlocale" );
1476 _LIT( Ktest1, "In Test4" );
1477 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1478 // Print to log file
1479 iLog->Log( Ktest1 );
1483 _LIT( KParam, "Param[%i]: %S" );
1487 basic_string<testChar> str = fac.truename();
1488 if (strcmp((char*)str.c_str(), "!") != 0)
1491 str = fac.falsename();
1492 if (strcmp((char*)str.c_str(), "!!") != 0)
1499 // -----------------------------------------------------------------------------
1500 // Ctlocale::numpunct_byname_test5L
1501 // -----------------------------------------------------------------------------
1504 struct Mynumpunct_byname : public numpunct_byname<testChar> {
1505 Mynumpunct_byname(const char *name, size_t refs)
1506 : numpunct_byname<testChar>(name, refs) {}
1507 string_type my_do_truename() const
1508 {return (do_truename()); }
1511 TInt Ctlocale::numpunct_byname1L( CStifItemParser& aItem )
1515 _LIT( Ktlocale, "tlocale" );
1516 _LIT( Ktest1, "In Test5" );
1517 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1518 // Print to log file
1519 iLog->Log( Ktest1 );
1523 _LIT( KParam, "Param[%i]: %S" );
1525 const Mynumpunct_byname fac("C", 1);
1526 basic_string<testChar> str = fac.my_do_truename();
1527 if(strcmp((char*)str.c_str(),"true") !=0)
1537 // -----------------------------------------------------------------------------
1538 // Ctlocale::num_get_test6L
1539 // -----------------------------------------------------------------------------
1542 typedef char_traits<testChar> mycharite;
1543 typedef istreambuf_iterator<testChar, mycharite> myistrite;
1545 struct Mynum_get : public num_get<testChar, myistrite> {
1546 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1547 ios_base::iostate& st, bool& val) const
1548 {return (do_get(first, last, str, st, val)); }
1549 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1550 ios_base::iostate& st, long& val) const
1551 {return (do_get(first, last, str, st, val)); }
1552 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1553 ios_base::iostate& st, unsigned long& val) const
1554 {return (do_get(first, last, str, st, val)); }
1555 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1556 ios_base::iostate& st, double& val) const
1557 {return (do_get(first, last, str, st, val)); }
1558 #ifndef __SYMBIAN32__
1559 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1560 ios_base::iostate& st, long double& val) const
1561 {return (do_get(first, last, str, st, val)); }
1563 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1564 ios_base::iostate& st, unsigned short& val) const // [NOV95]
1565 {return (do_get(first, last, str, st, val)); }
1566 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1567 ios_base::iostate& st, unsigned int& val) const
1568 {return (do_get(first, last, str, st, val)); }
1569 iter_type my_do_get(iter_type first, iter_type last, ios_base& str,
1570 ios_base::iostate& st, float& val) const
1571 {return (do_get(first, last, str, st, val)); }
1574 TInt Ctlocale::num_get1L( CStifItemParser& aItem )
1578 _LIT( Ktlocale, "tlocale" );
1579 _LIT( Ktest1, "In Test6" );
1580 TestModuleIf().Printf( 0, Ktlocale, Ktest1 );
1581 // Print to log file
1582 iLog->Log( Ktest1 );
1586 _LIT( KParam, "Param[%i]: %S" );
1589 basic_string<testChar> str1;
1590 Convert_string2_string_chart(str1,"1V-2W3X4.00Y6A7B-8.C");
1592 basic_istringstream<testChar> istr(str1);
1593 myistrite first(istr.rdbuf()), last;
1595 ios_base::iostate st = ios_base::goodbit;
1596 first = fac.my_do_get(first, last, istr, st, bv);
1599 if ((char)*first!= 'V');