73 static const std::locale::category cats[] = {
77 std::locale::messages,
78 std::locale::monetary,
84 static const std::size_t ncats =
sizeof cats /
sizeof *cats;
99 const std::locale first (next.name ().c_str ());
100 const std::locale second (next.name ().c_str ());
106 const std::locale third (first);
111 const std::size_t ninx = (
i + 1) %
nlocales;
112 const char*
const next_name =
locales [ninx];
115 next = std::locale (next_name);
119 const std::size_t cinx =
i % ncats;
120 const std::locale::category cat = cats [cinx];
125 const std::locale combined (first, next_name, cat);
128 if ( std::locale::none == cat
129#
if defined (_MSC_VER) || defined (__MINGW32__)
130 || std::locale::messages == cat
135 else if (std::locale::all == cat)
138 RW_ASSERT (combined != first && combined != next);
141 const std::locale combined_2 (first, next, cat);
143 if ( std::locale::none == cat
144#
if defined (_MSC_VER) || defined (__MINGW32__)
145 || std::locale::messages == cat
150 else if (std::locale::all == cat)
153 RW_ASSERT (combined_2 != first && combined_2 != next);
177 if (nlocales == maxinx)
184 "testing std::locale ctors with %d thread%{?}s%{;}, "
185 "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
188 nlocales,
int (nlocales),
"%#s", locales);
195 "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
203int main (
int argc,
char *argv[])
205#ifdef _RWSTD_REENTRANT
215 return rw_test (argc, argv, __FILE__,
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
const struct @19 locales[]
_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_error(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_opt_setlocales(int, char *[])
_TEST_EXPORT const char *const & rw_opt_locales
_TEST_EXPORT char * rw_locales(int=_UNUSED_CAT, const char *=0, bool=true)
_TEST_EXPORT int rw_thread_pool(rw_thread_t *, _RWSTD_SIZE_T, rw_thread_attr_t *, rw_thread_proc *, void **, _RWSTD_SIZE_T=0)
_TEST_EXPORT int rw_get_cpus()
_TEST_EXPORT int rw_thread_pool_timeout_expired()