33#if defined __IBMCPP__ && !defined _RWSTD_NO_IMPLICIT_INCLUSION
34# define _RWSTD_NO_IMPLICIT_INCLUSION
38#if defined _RWSTD_NO_EXPORT && !defined _MSC_VER
39# define protected public
50 rw_info (0, __FILE__, __LINE__,
"checking LC_XXX constants");
54 static const char*
const lc_defs[] =
81 for (
unsigned i = 0;
i !=
sizeof lc_defs /
sizeof *lc_defs; ++
i) {
83 "<locale> unexpectedly #defines %s", lc_defs [
i]);
90 rw_info (0, __FILE__, __LINE__,
"checking isxxx() macros");
93 static const char*
const isxxx[] =
138 for (
unsigned i = 0;
i !=
sizeof isxxx /
sizeof *isxxx; ++
i) {
140 "<locale> unexpectedly #defines %s", isxxx [
i]);
149#if !defined LC_MESSAGES && defined _RWSTD_LC_MESSAGES
150# define LC_MESSAGES _RWSTD_LC_MESSAGES
154#define FUN(result, name, arg_list) do { \
156 result (*_RWSTD_PASTE (pf, __LINE__)) arg_list = &name; \
157 _RWSTD_UNUSED (_RWSTD_PASTE (pf, __LINE__)); \
163template <
class charT>
165test_have_use_facet ()
167 rw_info (0, __FILE__, __LINE__,
168 "std::has_facet<Facet>(std::locale&) synopsis");
169 rw_info (0, __FILE__, __LINE__,
170 "std::use_facet<Facet>(std::locale&) synopsis");
172#if !defined __HP_aCC || __HP_aCC > 33100
176# if !(defined __GNUG__ || __GNUG__ > 2 || __GNUC_MINOR__ > 96) \
177 && !(defined _MSC_VER || _MSC_VER >= 0x1300)
181 FUN (
const std::ctype<charT>&,
182 std::use_facet<std::ctype<charT> >, (
const std::locale&));
183 FUN (
bool, std::has_facet<std::ctype<charT> >, (
const std::locale&));
193template <
class charT>
195test_convenience_funs ()
197 rw_info (0, __FILE__, __LINE__,
198 "std::isxxx(std::locale&) convenience functions synopsis");
200 FUN (
bool, std::isspace, (
charT,
const std::locale&));
201 FUN (
bool, std::isprint, (
charT,
const std::locale&));
202 FUN (
bool, std::iscntrl, (
charT,
const std::locale&));
203 FUN (
bool, std::isupper, (
charT,
const std::locale&));
204 FUN (
bool, std::islower, (
charT,
const std::locale&));
205 FUN (
bool, std::isalpha, (
charT,
const std::locale&));
206 FUN (
bool, std::isdigit, (
charT,
const std::locale&));
207 FUN (
bool, std::ispunct, (
charT,
const std::locale&));
208 FUN (
bool, std::isxdigit, (
charT,
const std::locale&));
209 FUN (
bool, std::isalnum, (
charT,
const std::locale&));
210 FUN (
bool, std::isgraph, (
charT,
const std::locale&));
223# ifndef _RWSTD_NO_WCHAR_T
238template <
class charT>
243 typedef charT char_type;
245 const std::locale::facet *pfac;
250 const std::collate<char_type> *col = 0;
251 const std::collate_byname<char_type> *col_byname = 0;
263 const std::ctype<char_type> *ctp = 0;
264 const std::ctype_byname<char_type> *ctp_byname = 0;
267 const std::ctype_base *ctpbase = ctp;
275 const std::codecvt<char_type, char, std::mbstate_t> *
cvt = 0;
276 const std::codecvt_byname<char_type, char, std::mbstate_t>
282 const std::codecvt_base *pcvtbase =
cvt;
288 typedef std::char_traits<char_type> CTr;
289 typedef std::istreambuf_iterator<char_type, CTr > IIt;
290 typedef std::ostreambuf_iterator<char_type, CTr > OIt;
295 const std::moneypunct<char_type, false> *mpun = 0;
296 const std::moneypunct<char_type, true> *mpun_intl = 0;
297 const std::moneypunct_byname<char_type, false> *mpun_byname = 0;
298 const std::moneypunct_byname<char_type, true> *mpun_intl_byname = 0;
299 const std::money_get<char_type, IIt> *mget = 0;
300 const std::money_put<char_type, OIt> *mput = 0;
309 mpun_intl = mpun_intl_byname;
312 const std::money_base *pmbase = mpun;
316#ifndef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
318 const std::moneypunct<char_type> *pmpun_noarg = mpun;
322 const std::money_get<char_type> *pmget = mget;
323 const std::money_put<char_type> *pmput = mput;
334 const std::num_get<char_type, IIt> *nget = 0;
335 const std::num_put<char_type, OIt> *nput = 0;
341#ifndef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
344 const std::num_get<char_type> *pnget = nget;
345 const std::num_put<char_type> *pnput = nput;
356 const std::time_get<char_type, IIt> *tget = 0;
357 const std::time_put<char_type, OIt> *tput = 0;
363#ifndef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
366 const std::time_get<char_type> *ptget = tget;
367 const std::time_put<char_type> *ptput = tput;
378 const std::messages<char_type> *msgs = 0;
379 const std::messages_byname<char_type> *msgs_byname = 0;
384 const std::messages_base *pmsgbase = msgs;
385 const std::messages<char_type> *pmsgs = msgs_byname;
402# ifndef _RWSTD_NO_WCHAR_T
429static bool dtor_called =
false;
433 typedef std::locale::facet
Base;
443 static std::locale::id
id;
451static bool is_dtor_virtual;
454template <
class charT>
459 typedef std::basic_string<charT, traits_type, Allocator>
string_type;
467 rw_info (0, __FILE__, __LINE__,
"class std::locale synopsis");
470 const std::locale::category *pcat = (
int*)0;
472#ifndef _RWSTD_NO_STATIC_CONST_MEMBER_INIT
475 pcat = &std::locale::none;
476 pcat = &std::locale::collate;
477 pcat = &std::locale::ctype;
478 pcat = &std::locale::monetary;
479 pcat = &std::locale::numeric;
480 pcat = &std::locale::time;
481 pcat = &std::locale::messages;
482 pcat = &std::locale::all;
488 case std::locale::none:
489 case std::locale::collate:
490 case std::locale::ctype:
491 case std::locale::monetary:
492 case std::locale::numeric:
493 case std::locale::time:
494 case std::locale::messages:
495 case std::locale::all:
499 static const int c_cats [] = {
508 static const std::locale::category cats[] = {
509 std::locale::none, std::locale::collate, std::locale::ctype,
510 std::locale::monetary, std::locale::numeric, std::locale::time,
511 std::locale::messages, std::locale::all
514 for (pcat = cats; pcat != cats +
sizeof cats /
sizeof *cats - 1; ++pcat) {
518 for (
unsigned i = pcat - cats + 1;
i <
sizeof cats /
sizeof *cats; ++
i)
519 if ( *pcat != std::locale::all
520 && cats [
i] != std::locale::all
521 && (*pcat & cats [
i]))
522 rw_assert (success =
false, __FILE__, __LINE__,
523 "(%{Lc} & %{Lc}) != 0", *pcat, cats [
i]);
525 for (
unsigned j = 0;
j !=
sizeof c_cats /
sizeof *c_cats; ++
j) {
527 if (*pcat & c_cats [
j])
528 rw_assert (success =
false, __FILE__, __LINE__,
529 "(%{Lc} & %{Lc}) != 0", *pcat, c_cats [
j]);
531 if (*pcat == c_cats [
j])
532 rw_assert (success =
false, __FILE__, __LINE__,
533 "%{Lc} != %{Lc}", *pcat, c_cats [
j]);
536 rw_assert (success, __FILE__, __LINE__,
"%{Lc}", *pcat);
540 const int all = std::locale::collate
542 | std::locale::monetary
543 | std::locale::numeric
545 | std::locale::messages;
547 rw_assert (std::locale::all == all, __FILE__, __LINE__,
548 "std::locale::all == %#x, got %#x", all, std::locale::all);
557 struct Facet: std::locale::facet {
559 typedef std::locale::facet
Base;
564 is_dtor_virtual =
true;
570 delete (std::locale::facet*)
new Facet ();
571 rw_assert (is_dtor_virtual, __FILE__, __LINE__,
572 "locale::facet::~facet() not virtual");
586 (void)std::locale (
"");
592 (void)std::locale (l,
"", std::locale::all);
601 (void)std::locale (l,
pf);
605 rw_assert (!dtor_called, __FILE__, __LINE__,
606 "facet dtor called for ref count of 1");
621 (void)std::locale (l,
pf);
624 rw_assert (dtor_called, __FILE__, __LINE__,
625 "UD facet dtor not called for ref count of 0");
633 (void)std::locale (l, l, std::locale::all);
637#define MEMFUN(result, name, arg_list) \
640 result (std::locale::* _RWSTD_PASTE (pf, __LINE__)) \
641 arg_list = &std::locale::name; \
642 _RWSTD_UNUSED (_RWSTD_PASTE (pf, __LINE__)); \
645#if !defined __HP_aCC || __HP_aCC > 33100
654#if !defined __HP_aCC || __HP_aCC > 33100
659 MEMFUN (std::locale, combine<Facet>, (
const std::locale&)
const);
667 MEMFUN (
bool,
operator==, (
const std::locale&)
const);
670 MEMFUN (
bool,
operator!=, (
const std::locale&)
const);
673 MEMFUN (
bool,
operator(), (
const std::string&,
const std::string&)
const);
675#ifndef _RWSTD_NO_WCHAR_T
677 MEMFUN (
bool,
operator(), (
const std::wstring&,
const std::wstring&)
const);
684 MEMFUN (
bool,
operator(), (
const IntString&,
const IntString&)
const);
687 FUN (std::locale, std::locale::global, (
const std::locale&));
688 FUN (
const std::locale&, std::locale::classic, ());
695template <
class charT>
699 typedef std::ctype_base::mask
M;
705#define MEMFUN(result, name, arg_list) \
707 result (CtypeT::* pf) arg_list = &CtypeT::name; \
708 _RWSTD_UNUSED (pf); \
725 do_widen, (
const char*,
const char*,
charT*)
const);
734template <
class charT>
745 typedef std::ctype_base::mask
Mask;
752 :
CtypeT (tbl, del, ref) { }
756#ifndef _RWSTD_NO_STATIC_CONST_MEMBER_INIT
759 const std::size_t *psz = &std::ctype<char>::table_size;
763 const std::size_t dummy = std::ctype<char>::table_size;
764 const std::size_t *psz = &dummy;
770 case std::ctype<char>::table_size:
break;
773 MEMFUN (
char, do_toupper, (
char)
const);
774 MEMFUN (
const char*, do_toupper, (
char*,
const char*)
const);
775 MEMFUN (
char, do_tolower, (
char)
const);
776 MEMFUN (
const char*, do_tolower, (
char*,
const char*)
const);
777 MEMFUN (
char, do_widen, (
char)
const);
778 MEMFUN (
const char*, do_widen,
779 (
const char*,
const char*,
char*)
const);
780 MEMFUN (
char, do_narrow, (
char,
char)
const);
781 MEMFUN (
const char*, do_narrow,
782 (
const char*,
const char*,
char,
char*)
const);
785 MEMFUN (
const std::ctype_base::mask*,
789 FUN (
const std::ctype_base::mask*,
813static int opt_enable_posix = 0;
816template <
class charT>
818test_ctype (
const char* cname)
820 rw_info (0, __FILE__, __LINE__,
821 "std::ctype<%s> synopsis", cname);
823 std::ctype_base::mask
m = std::ctype_base::space;
826 const std::ctype_base::mask *pm = 0;
833#ifndef _RWSTD_NO_STATIC_CONST_MEMBER_INIT
835# define ADDR(name) pm = &std::ctype_base::name
837# define ADDR(ignore) (void)0
840#if !defined __IBMCPP__ || __IBMCPP__ > 800
842 case std::ctype_base::mask (): break;
845 case std::ctype_base::space:
ADDR (space);
break;
846 case std::ctype_base::print:
ADDR (
print);
break;
847 case std::ctype_base::cntrl:
ADDR (
cntrl);
break;
848 case std::ctype_base::upper:
ADDR (
upper);
break;
849 case std::ctype_base::lower:
ADDR (
lower);
break;
850 case std::ctype_base::alpha:
ADDR (alpha);
break;
851 case std::ctype_base::digit:
ADDR (digit);
break;
852 case std::ctype_base::punct:
ADDR (
punct);
break;
853 case std::ctype_base::xdigit:
ADDR (xdigit);
break;
854 case std::ctype_base::alnum:
ADDR (alnum);
break;
855 case std::ctype_base::graph:
ADDR (
graph);
break;
861 if (
sizeof (
charT) ==
sizeof (
char)) {
863 (std::ctype_base::alpha | std::ctype_base::digit),
865 "std::ctype_base::alnum = %#x, expected %#x",
866 std::ctype_base::alnum,
867 std::ctype_base::alpha | std::ctype_base::digit);
869 if (opt_enable_posix) {
874 == (std::ctype_base::alnum | std::ctype_base::punct),
876 "std::ctype_base::graph = %#x, expected %#x",
877 std::ctype_base::graph,
878 std::ctype_base::alnum | std::ctype_base::punct);
882 typedef std::ctype<charT> CtypeT;
883 typedef typename CtypeT::mask Mask;
885 charT *pc = (
typename CtypeT::char_type*)0;
888 typedef const charT* PtrT;
891 MEMFUN (PtrT, is, (PtrT, PtrT, Mask*)
const);
892 MEMFUN (PtrT, scan_is, (Mask, PtrT, PtrT)
const);
893 MEMFUN (PtrT, scan_not, (Mask, PtrT, PtrT)
const);
902 (PtrT, PtrT,
char,
char*)
const);
904 std::locale::id *pid = &CtypeT::id;
909 test_ctype_specialization<charT> ();
914template <
class charT>
917 typedef std::codecvt<charT, char, std::mbstate_t>
Codecvt;
918 typedef std::codecvt_base::result
Result;
919 typedef typename Codecvt::intern_type
InternT;
920 typedef typename Codecvt::extern_type
ExternT;
921 typedef typename Codecvt::state_type
StateT;
926#define MEMFUN(result, name, arg_list) \
928 result (Codecvt::*pf) arg_list = &Codecvt::name; \
929 _RWSTD_UNUSED (pf); \
958template <
class charT>
962 rw_info (0, __FILE__, __LINE__,
963 "std::codecvt<%s, char, std::mbstate_t> synopsis", cname);
967 std::codecvt_base::result
r =
b.ok;
974 case std::codecvt_base::ok:
975 case std::codecvt_base::partial:
976 case std::codecvt_base::error:
977 case std::codecvt_base::noconv:
981 typedef std::codecvt<charT, char, std::mbstate_t>
Codecvt;
984 typedef typename Codecvt::intern_type InternT;
985 typedef typename Codecvt::extern_type ExternT;
986 typedef typename Codecvt::state_type
StateT;
990 const ExternT *pext = (
const char*)0;
991 const StateT *pst = (
const std::mbstate_t*)0;
997 typedef std::codecvt_base::result
Result;
1001 (
StateT&,
const InternT*,
const InternT*,
const InternT*&,
1002 ExternT*, ExternT*, ExternT*&)
const);
1007 (
StateT&,
const ExternT*,
const ExternT*,
const ExternT*&,
1008 InternT*, InternT*, InternT*&)
const);
1015 (
StateT&,
const ExternT*,
const ExternT*, std::size_t)
const);
1019 std::locale::id *pid = &Codecvt::id;
1039struct numpunct<
UDC>: locale::facet
1059locale::id numpunct<UDC>::id;
1064template <
class charT>
1073#define MEMFUN(result, name, arg_list) \
1075 result (NumPunct::*pf) arg_list = &NumPunct::name; \
1076 _RWSTD_UNUSED (pf); \
1083 MEMFUN (std::string, do_grouping, ()
const);
1090template <
class charT>
1092test_numpunct (
const char* cname)
1094 rw_info (0, __FILE__, __LINE__,
1095 "std::numpunct<%s> synopsis", cname);
1097 typedef std::numpunct<charT> NumPunct;
1101 typename NumPunct::char_type *pc = (
charT*)0;
1102 typename NumPunct::string_type *pstr = (StringT*)0;
1110 MEMFUN (std::string, grouping, ()
const);
1111 MEMFUN (StringT, truename, ()
const);
1112 MEMFUN (StringT, falsename, ()
const);
1115 std::locale::id *pid = &NumPunct::id;
1126template <
class charT,
class IterT>
1134#define MEMFUN(result, name, arg_list) \
1136 result (NumGet::*pf) arg_list = &NumGet::name; \
1137 _RWSTD_UNUSED (pf); \
1153#ifdef _RWSTD_LONG_LONG
1176template <
class charT,
class IterT>
1178test_num_get (
const char* cname,
const char* iname)
1180 rw_info (0, __FILE__, __LINE__,
1181 "std::num_get<%s, %s > synopsis", cname, iname);
1183 typedef std::num_get<charT, IterT>
NumGet;
1186 typename NumGet::char_type *pc = (
charT*)0;
1187 typename NumGet::iter_type *pi = (IterT*)0;
1202#ifdef _RWSTD_LONG_LONG
1222 std::locale::id *pid = &NumGet::id;
1229template <
class charT,
class IterT>
1237#define MEMFUN(result, name, arg_list) \
1239 result (NumPut::*pf) arg_list = &NumPut::name; \
1240 _RWSTD_UNUSED (pf); \
1251#ifdef _RWSTD_LONG_LONG
1269template <
class charT,
class IterT>
1273 rw_info (0, __FILE__, __LINE__,
1274 "std::num_put<%s, %s > synopsis", cname, iname);
1276 typedef std::num_put<charT, IterT>
NumPut;
1290#ifdef _RWSTD_LONG_LONG
1304 std::locale::id *pid = &NumPut::id;
1314template <
class charT>
1324#define MEMFUN(result, name, arg_list) \
1326 result (Collate::* pf) arg_list = &Collate::name; \
1327 _RWSTD_UNUSED (pf); \
1337 std::locale::id *pid = &Collate::id;
1349template <
class charT>
1351test_collate (
const char* cname)
1353 rw_info (0, __FILE__, __LINE__,
1354 "std::collate<%s> synopsis", cname);
1356 typedef std::collate<charT>
Collate;
1360 typename Collate::char_type *pc = (
charT*)0;
1361 typename Collate::string_type *pstr = (StringT*)0;
1373template <
class charT,
class IterT>
1381#define MEMFUN(result, name, arg_list) \
1383 result (TimeGet::* pf) arg_list = &TimeGet::name; \
1384 _RWSTD_UNUSED (pf); \
1389 MEMFUN (std::time_base::dateorder, do_date_order, ()
const);
1390 MEMFUN (IterT, do_get_time,
1392 MEMFUN (IterT, do_get_date,
1394 MEMFUN (IterT, do_get_weekday,
1396 MEMFUN (IterT, do_get_monthname,
1398 MEMFUN (IterT, do_get_year,
1404template <
class charT,
class IterT>
1406test_time_get (
const char* cname,
const char* iname)
1408 rw_info (0, __FILE__, __LINE__,
1409 "std::time_get<%s, %s > synopsis", cname, iname);
1411 typedef std::time_get<charT, IterT>
TimeGet;
1414 std::time_base::dateorder ord = std::time_base::no_order;
1416 case std::time_base::no_order:
1417 case std::time_base::dmy:
case std::time_base::mdy:
1418 case std::time_base::ymd:
case std::time_base::ydm:
1423 rw_assert (0 == std::time_base::no_order, __FILE__, __LINE__,
1424 "std::time_base::no_order");
1425 rw_assert (1 == std::time_base::dmy, __FILE__, __LINE__,
1426 "std::time_base::dmy");
1427 rw_assert (2 == std::time_base::mdy, __FILE__, __LINE__,
1428 "std::time_base::mdy");
1429 rw_assert (3 == std::time_base::ymd, __FILE__, __LINE__,
1430 "std::time_base::ymd");
1431 rw_assert (4 == std::time_base::ydm, __FILE__, __LINE__,
1432 "std::time_base::ydm");
1435 typename TimeGet::char_type *pc = (
charT*)0;
1436 typename TimeGet::iter_type *pi = (IterT*)0;
1442 MEMFUN (std::time_base::dateorder, date_order, ()
const);
1447 MEMFUN (IterT, get_weekday,
1449 MEMFUN (IterT, get_monthname,
1454 std::locale::id *pid = &TimeGet::id;
1461template <
class charT,
class IterT>
1469#define MEMFUN(result, name, arg_list) \
1471 result (TimePut::*pf) arg_list = &TimePut::name; \
1472 _RWSTD_UNUSED (pf); \
1483template <
class charT,
class IterT>
1485test_time_put (
const char* cname,
const char* iname)
1487 rw_info (0, __FILE__, __LINE__,
1488 "std::time_put<%s, %s > synopsis", cname, iname);
1490 typedef std::time_put<charT, IterT>
TimePut;
1493 typename TimePut::char_type *pc = (
charT*)0;
1494 typename TimePut::iter_type *pi = (IterT*)0;
1505 std::locale::id *pid = &TimePut::id;
1522struct moneypunct<
UDC,
false>: locale::facet, money_base
1531 :
Base (refs), money_base () { }
1535 enum { intl =
false };
1548locale::id moneypunct<UDC, false>::id;
1552struct moneypunct<
UDC,
true>: locale::facet, money_base
1561 :
Base (refs), money_base () { }
1565 enum { intl =
true };
1578locale::id moneypunct<UDC, true>::id;
1583template <
class charT,
bool Intl>
1592#define MEMFUN(result, name, arg_list) \
1594 result (MoneyPunct::* pf) arg_list = &MoneyPunct::name; \
1595 _RWSTD_UNUSED (pf); \
1603 MEMFUN (std::string, do_grouping, ()
const );
1607 MEMFUN (
int, do_frac_digits, ()
const);
1608 MEMFUN (std::money_base::pattern, do_pos_format, ()
const);
1609 MEMFUN (std::money_base::pattern, do_neg_format, ()
const);
1614template <
class charT>
1616test_moneypunct (
const char* cname)
1618 rw_info (0, __FILE__, __LINE__,
1619 "std::moneypunct<%s, bool> synopsis", cname);
1621 typedef std::moneypunct<charT, false> MoneyPunct;
1624 typename MoneyPunct::char_type *pc = (
charT*)0;
1625 typename MoneyPunct::string_type *ps = (StringT*)0;
1632 MEMFUN (std::string, grouping, ()
const );
1633 MEMFUN (StringT, curr_symbol, ()
const);
1634 MEMFUN (StringT, positive_sign, ()
const);
1635 MEMFUN (StringT, negative_sign, ()
const);
1636 MEMFUN (
int, frac_digits, ()
const);
1637 MEMFUN (std::money_base::pattern, pos_format, ()
const);
1638 MEMFUN (std::money_base::pattern, neg_format, ()
const);
1640 std::locale::id *pid = &MoneyPunct::id;
1647template <
class charT,
class IterT>
1656#define MEMFUN(result, name, arg_list) \
1658 result (MoneyGet::*pf) arg_list = &MoneyGet::name; \
1659 _RWSTD_UNUSED (pf); \
1665#ifndef _RWSTD_NO_LONG_DOUBLE
1668 IoState&,
long double&)
const);
1683template <
class charT,
class IterT>
1685test_money_get (
const char* cname,
const char* iname)
1687 rw_info (0, __FILE__, __LINE__,
1688 "std::money_get<%s, %s > synopsis", cname, iname);
1690 typedef std::money_get<charT, IterT>
MoneyGet;
1694 typename MoneyGet::char_type *pc = (
charT*)0;
1695 typename MoneyGet::iter_type *pi = (IterT*)0;
1696 typename MoneyGet::string_type *ps = (StringT*)0;
1704 IoState&,
long double&)
const);
1708 std::locale::id *pid = &MoneyGet::id;
1715template <
class charT,
class IterT>
1724#define MEMFUN(result, name, arg_list) \
1726 result (MoneyPut::*pf) arg_list = &MoneyPut::name; \
1727 _RWSTD_UNUSED (pf); \
1733#ifndef _RWSTD_NO_LONG_DOUBLE
1736 long double)
const);
1750template <
class charT,
class IterT>
1752test_money_put (
const char* cname,
const char* iname)
1754 rw_info (0, __FILE__, __LINE__,
1755 "std::money_put<%s, %s > synopsis", cname, iname);
1757 typedef std::money_put<charT, IterT>
MoneyPut;
1761 typename MoneyPut::char_type *pc = (
charT*)0;
1762 typename MoneyPut::iter_type *pi = (IterT*)0;
1763 typename MoneyPut::string_type *ps = (StringT*)0;
1771 long double)
const);
1773 const StringT&)
const);
1775 std::locale::id *pid = &MoneyPut::id;
1785template <
class charT>
1794#define MEMFUN(result, name, arg_list) \
1796 result (Messages::* pf) arg_list = &Messages::name; \
1797 _RWSTD_UNUSED (pf); \
1804 (
const std::string&,
const std::locale&)
const);
1806 MEMFUN (
void, do_close, (
int)
const);
1811template <
class charT>
1815 rw_info (0, __FILE__, __LINE__,
1816 "std::messages<%s> synopsis", cname);
1818 typedef std::messages<charT>
Messages;
1822 std::messages_base::catalog *pcat = (
int*)0;
1823 typename Messages::char_type *pc = (
charT*)0;
1824 typename Messages::string_type *pstr = (StringT*)0;
1831 MEMFUN (
int,
open, (
const std::string&,
const std::locale&)
const);
1832 MEMFUN (StringT, get, (
int,
int,
int,
const StringT&)
const);
1835 std::locale::id *pid = &Messages::id;
1850 test_have_use_facet<char> ();
1853 test_convenience_funs<char> ();
1856 test_facets<char> ();
1862#define FUN1(fun, charT) \
1863 fun< charT > (#charT)
1866 FUN1 (test_collate,
char);
1869 FUN1 (test_codecvt,
char);
1870 FUN1 (test_ctype,
char);
1873#define FUN2(fun, charT, IterT) \
1874 fun< charT, IterT > (#charT, #IterT)
1877 FUN1 (test_moneypunct,
char);
1878 FUN2 (test_money_get,
char, std::istreambuf_iterator<char>);
1879 FUN2 (test_money_get,
char,
const char*);
1880 FUN2 (test_money_put,
char, std::ostreambuf_iterator<char>);
1881 FUN2 (test_money_put,
char,
char*);
1884 FUN1 (test_numpunct,
char);
1885 FUN2 (test_num_get,
char, std::istreambuf_iterator<char>);
1886 FUN2 (test_num_get,
char,
const char*);
1891 FUN2 (test_time_get,
char, std::istreambuf_iterator<char>);
1892 FUN2 (test_time_get,
char,
const char*);
1893 FUN2 (test_time_put,
char, std::ostreambuf_iterator<char>);
1894 FUN2 (test_time_put,
char,
char*);
1897 FUN1 (test_messages,
char);
1899#ifndef _RWSTD_NO_WCHAR_T
1902 test_have_use_facet<wchar_t> ();
1903 test_convenience_funs<wchar_t> ();
1904 test_facets<wchar_t> ();
1906 FUN1 (test_collate,
wchar_t);
1908 FUN1 (test_ctype,
wchar_t);
1909 FUN1 (test_codecvt,
wchar_t);
1911 FUN1 (test_moneypunct,
wchar_t);
1912 FUN2 (test_money_get,
wchar_t, std::istreambuf_iterator<wchar_t>);
1913 FUN2 (test_money_get,
wchar_t,
const wchar_t*);
1914 FUN2 (test_money_put,
wchar_t, std::ostreambuf_iterator<wchar_t>);
1915 FUN2 (test_money_put,
wchar_t,
wchar_t*);
1917 FUN1 (test_numpunct,
wchar_t);
1918 FUN2 (test_num_get,
wchar_t, std::istreambuf_iterator<wchar_t>);
1919 FUN2 (test_num_get,
wchar_t,
const wchar_t*);
1923 FUN2 (test_time_get,
wchar_t, std::istreambuf_iterator<wchar_t>);
1924 FUN2 (test_time_get,
wchar_t,
const wchar_t*);
1925 FUN2 (test_time_put,
wchar_t, std::ostreambuf_iterator<wchar_t>);
1926 FUN2 (test_time_put,
wchar_t,
wchar_t*);
1928 FUN1 (test_messages,
wchar_t);
1936 FUN2 (test_money_get,
UDC, std::istreambuf_iterator<UDC>);
1939 FUN2 (test_money_put,
UDC, std::ostreambuf_iterator<UDC>);
1942 FUN2 (test_num_get,
UDC, std::istreambuf_iterator<UDC>);
1948 FUN2 (test_time_get,
char,
const char*);
1949 FUN2 (test_time_put,
char,
char*);
1957 return rw_test (argc, argv, __FILE__,
1958 "lib.locales",
"header <locale> synopsis",
1959 run_test,
"|-enable-posix# ", &opt_enable_posix);
#define _PTR_THROWS(spec)
std::codecvt< char, char, std::mbstate_t > Codecvt
void test_codecvt(const Codecvt *pcvt=0)
const char * widen(char *dst, const char *src)
const char * narrow(char *dst, const char *src)
std::collate< char > Collate
std::time_get< char > TimeGet
std::messages< char > Messages
std::time_put< char > TimePut
void test_messages(charT, const char *cname, const char *locname)
_RWSTD_SPECIALIZED_FUNCTION void test_ctype_specialization< char >()
void is_explicit(const std::locale &)
#define FUN2(fun, charT, IterT)
#define FUN(result, name, arg_list)
#define MEMFUN(result, name, arg_list)
std::ios_base::iostate IoState
void test_ctype_specialization()
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_UNUSED(arg)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_SPECIALIZED_FUNCTION
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_info(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
int do_encoding() const _THROWS(())
Codecvt::state_type StateT
void test_protected_members()
Codecvt::intern_type InternT
std::codecvt< charT, char, std::mbstate_t > Codecvt
Codecvt::extern_type ExternT
std::codecvt_base::result Result
int do_max_length() const _THROWS(())
bool do_always_noconv() const _THROWS(())
static void test_protected_members()
StringTypes< charT >::string_type StringT
std::collate< charT > Collate
static void test_protected_members()
CtypeCharDerived(const Mask *tbl, bool del)
CtypeCharDerived(const Mask *tbl)
CtypeCharDerived(const Mask *tbl, bool del, std::size_t ref)
std::ctype< char > CtypeT
std::ctype_base::mask Mask
static void test_protected_members()
std::ctype< charT > CtypeT
Facet(std::size_t refs=0)
static std::locale::id id
StringTypes< charT >::string_type StringT
std::messages< charT > Messages
static void test_protected_members()
static void test_protected_members()
std::money_get< charT, IterT > MoneyGet
StringTypes< charT >::string_type StringT
std::moneypunct< charT, Intl > MoneyPunct
static void test_protected_members()
StringTypes< charT >::string_type StringT
static void test_protected_members()
StringTypes< charT >::string_type StringT
std::money_put< charT, IterT > MoneyPut
static void test_protected_members()
std::num_get< charT, IterT > NumGet
std::numpunct< charT > NumPunct
static void test_protected_members()
StringTypes< charT >::string_type StringT
static void test_protected_members()
std::num_put< charT, IterT > NumPut
Base::char_type char_type
Base::iter_type iter_type
std::char_traits< charT > traits_type
std::allocator< charT > Allocator
std::basic_string< charT, traits_type, Allocator > string_type
std::time_get< charT, IterT > TimeGet
static void test_protected_members()
std::time_put< charT, IterT > TimePut
static void test_protected_members()
has_implicit_ctor(std::size_t)
has_implicit_ctor(const char *)
has_implicit_ctor(const std::ctype_base::mask *)
StringTypes< char_type >::string_type string_type
pattern pos_format() const
moneypunct(size_t refs=0)
pattern neg_format() const
string_type positive_sign() const
char_type decimal_point() const
string_type negative_sign() const
char_type thousands_sep() const
string_type curr_symbol() const
pattern pos_format() const
char_type decimal_point() const
string_type negative_sign() const
moneypunct(size_t refs=0)
pattern neg_format() const
string_type positive_sign() const
StringTypes< char_type >::string_type string_type
string_type curr_symbol() const
char_type thousands_sep() const
StringTypes< char_type >::string_type string_type
char_type decimal_point() const
char_type thousands_sep() const
string_type falsename() const
string_type truename() const
std::__rw_smanip< time_get_manip< charT >, const charT * > get_time(std::tm *tmb, const charT *fmt)