You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by vi...@apache.org on 2008/05/08 17:42:36 UTC
svn commit: r654561 - /stdcxx/branches/4.2.x/tests/localization/
Author: vitek
Date: Thu May 8 08:42:36 2008
New Revision: 654561
URL: http://svn.apache.org/viewvc?rev=654561&view=rev
Log:
2008-05-08 Travis Vitek <vi...@roguewave.com>
* tests/localization/22.locale.codecvt.mt.cpp (rw_opt_nthreads,
rw_opt_nloops, rw_opt_nlocales, rw_opt_shared_locale): Removed
rw_ prefix used by test driver symbols. Corrected formatting.
* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Corrected
formatting error caused by changes similar to those above.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
Modified:
stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp
stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp Thu May 8 08:42:36 2008
@@ -45,18 +45,18 @@
// default number of threads (will be adjusted to the number
// of processors/cores later)
-int rw_opt_nthreads = 1;
+int opt_nthreads = 1;
// the number of times each thread should iterate (unless specified
// otherwise on the command line)
-int rw_opt_nloops = 5000;
+int opt_nloops = 5000;
// number of locales to use
-int rw_opt_nlocales = MAX_THREADS;
+int opt_nlocales = MAX_THREADS;
// should all threads share the same set of locale objects instead
// of creating their own?
-int rw_opt_shared_locale;
+int opt_shared_locale;
/**************************************************************************/
@@ -314,7 +314,7 @@
const int ni = RW_COUNT_OF (nsrc);
const int wi = RW_COUNT_OF (wsrc);
- for (int i = 0; i != rw_opt_nloops; ++i) {
+ for (int i = 0; i != opt_nloops; ++i) {
const int inx = i % nlocales;
const MyCodecvtData& data = my_codecvt_data [inx];
@@ -322,8 +322,8 @@
// construct a named locale, get a reference to the codecvt
// facet from it and use it to format a random money value
const std::locale loc =
- rw_opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ opt_shared_locale ? data.locale_
+ : std::locale (data.locale_name_);
const MyCodecvtData::CvtId op =
MyCodecvtData::CvtId (i % MyCodecvtData::cvt_max);
@@ -460,7 +460,7 @@
run_test_fill<wchar_t>
(loc, wsrc [inx % wi], nsrc [inx % ni], data.wchar_data_);
- if (rw_opt_shared_locale)
+ if (opt_shared_locale)
data.locale_ = loc;
nlocales += 1;
@@ -471,7 +471,7 @@
"failed to create locale(%#s)", name);
}
- if (nlocales == maxinx || nlocales == std::size_t (rw_opt_nlocales))
+ if (nlocales == maxinx || nlocales == std::size_t (opt_nlocales))
break;
}
@@ -482,8 +482,8 @@
rw_info (0, 0, 0,
"testing std::codecvt<charT> with %d thread%{?}s%{;}, "
"%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
- rw_opt_nthreads, 1 != rw_opt_nthreads,
- rw_opt_nloops, 1 != rw_opt_nloops,
+ opt_nthreads, 1 != opt_nthreads,
+ opt_nloops, 1 != opt_nloops,
nlocales, int (nlocales), "%#s", locales);
///////////////////////////////////////////////////////////////////////
@@ -495,11 +495,11 @@
// create and start a pool of threads and wait for them to finish
int result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
///////////////////////////////////////////////////////////////////////
@@ -509,11 +509,11 @@
test_wchar = true;
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
///////////////////////////////////////////////////////////////////////
@@ -524,11 +524,11 @@
test_wchar = true;
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
return result;
}
@@ -541,9 +541,9 @@
// set nthreads to the greater of the number of processors
// and 2 (for uniprocessor systems) by default
- rw_opt_nthreads = rw_get_cpus ();
- if (rw_opt_nthreads < 2)
- rw_opt_nthreads = 2;
+ opt_nthreads = rw_get_cpus ();
+ if (opt_nthreads < 2)
+ opt_nthreads = 2;
#endif // _RWSTD_REENTRANT
@@ -555,10 +555,10 @@
"|-nlocales#0 " // arg must be non-negative
"|-locales= " // must be provided
"|-shared-locale# ",
- &rw_opt_nloops,
+ &opt_nloops,
int (MAX_THREADS),
- &rw_opt_nthreads,
- &rw_opt_nlocales,
+ &opt_nthreads,
+ &opt_nlocales,
&rw_opt_setlocales,
- &rw_opt_shared_locale);
+ &opt_shared_locale);
}
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp Thu May 8 08:42:36 2008
@@ -183,7 +183,7 @@
// facet from it and use it to format a random money value
const std::locale loc =
opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp Thu May 8 08:42:36 2008
@@ -191,7 +191,7 @@
// facet from it and use it to format a random money value
const std::locale loc =
opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp Thu May 8 08:42:36 2008
@@ -43,14 +43,14 @@
// default number of threads (will be adjusted to the number
// of processors/cores later)
-int rw_opt_nthreads = 1;
+int opt_nthreads = 1;
// the default number of times for each thread to iterate
#define DFLT_LOOPS 10000
// the number of times each thread should iterate (will be set to
// DFLT_LOOPS unless explicitly specified on the command line)
-int rw_opt_nloops = -1;
+int opt_nloops = -1;
/**************************************************************************/
@@ -240,7 +240,7 @@
static void*
thread_func (void*)
{
- for (int i = 0; i != rw_opt_nloops; ++i) {
+ for (int i = 0; i != opt_nloops; ++i) {
thread_loop_body (std::size_t (i));
}
@@ -388,13 +388,13 @@
// unless the number of iterations was explicitly specified
// on the command line, decrease the number to equal the number
// of excericsed locales when only one thread is being tested
- if (1 == rw_opt_nthreads && rw_opt_nloops < 0)
- rw_opt_nloops = int (nlocales);
+ if (1 == opt_nthreads && opt_nloops < 0)
+ opt_nloops = int (nlocales);
// when the number of iterations wasn't explicitly specified
// on the command line set it to the default value
- if (rw_opt_nloops < 0)
- rw_opt_nloops = DFLT_LOOPS;
+ if (opt_nloops < 0)
+ opt_nloops = DFLT_LOOPS;
rw_fatal (0 < nlocales, 0, __LINE__,
"must have at least one valid locale to test");
@@ -402,8 +402,8 @@
rw_info (0, 0, 0,
"testing std::moneypunct<charT> with %d thread%{?}s%{;}, "
"%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
- rw_opt_nthreads, 1 != rw_opt_nthreads,
- rw_opt_nloops, 1 != rw_opt_nloops,
+ opt_nthreads, 1 != opt_nthreads,
+ opt_nloops, 1 != opt_nloops,
nlocales, int (nlocales), "%#s", locales);
rw_info (0, 0, 0, "exercising std::moneypunct<char>");
@@ -413,11 +413,11 @@
// create and start a pool of threads and wait for them to finish
int result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
#ifndef _RWSTD_NO_WCHAR_T
@@ -429,11 +429,11 @@
// start a pool of threads to exercise the thread safety
// of the wchar_t specialization
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
// exercise both the char and the wchar_t specializations
// at the same time
@@ -447,11 +447,11 @@
// start a pool of threads to exercise wstring thread safety
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
#endif // _RWSTD_NO_WCHAR_T
@@ -466,9 +466,9 @@
// set nthreads to the greater of the number of processors
// and 2 (for uniprocessor systems) by default
- rw_opt_nthreads = rw_get_cpus ();
- if (rw_opt_nthreads < 2)
- rw_opt_nthreads = 2;
+ opt_nthreads = rw_get_cpus ();
+ if (opt_nthreads < 2)
+ opt_nthreads = 2;
#endif // _RWSTD_REENTRANT
@@ -478,8 +478,8 @@
"|-nloops#0 " // must be non-negative
"|-nthreads#0-* " // must be in [0, MAX_THREADS]
"|-locales=", // must be provided
- &rw_opt_nloops,
+ &opt_nloops,
int (MAX_THREADS),
- &rw_opt_nthreads,
+ &opt_nthreads,
&rw_opt_setlocales);
}
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp Thu May 8 08:42:36 2008
@@ -245,7 +245,7 @@
// so that the locale is used not only by the num_put facet
const std::locale loc =
opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp Thu May 8 08:42:36 2008
@@ -47,7 +47,7 @@
// the number of times each thread should iterate (unless specified
// otherwise on the command line)
-int rw_opt_nloops = 200000;
+int opt_nloops = 200000;
#if !defined (_RWSTD_OS_HP_UX) || defined (_ILP32)
@@ -111,7 +111,7 @@
static void*
thread_func (void*)
{
- for (int i = 0; i != rw_opt_nloops; ++i) {
+ for (int i = 0; i != opt_nloops; ++i) {
const std::size_t inx = std::size_t (i) % nlocales;
@@ -120,7 +120,7 @@
// construct a named locale
const std::locale loc =
opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet
@@ -250,7 +250,7 @@
"testing std::numpunct<charT> with %d thread%{?}s%{;}, "
"%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
opt_nthreads, 1 != opt_nthreads,
- rw_opt_nloops, 1 != rw_opt_nloops,
+ opt_nloops, 1 != opt_nloops,
nlocales, int (nlocales), "%#s", locales);
rw_info (0, 0, 0, "exercising std::numpunct<char>");
@@ -326,7 +326,7 @@
"|-nlocales#0 " // arg must be non-negative
"|-locales= " // must be provided
"|-shared-locale# ",
- &rw_opt_nloops,
+ &opt_nloops,
int (MAX_THREADS),
&opt_nthreads,
&opt_nlocales,
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp Thu May 8 08:42:36 2008
@@ -43,17 +43,17 @@
// default number of threads (will be adjusted to the number
// of processors/cores later)
-int rw_opt_nthreads = 1;
+int opt_nthreads = 1;
// the number of times each thread should iterate
-int rw_opt_nloops = 50000;
+int opt_nloops = 50000;
// number of locales to use
-int rw_opt_nlocales = MAX_THREADS;
+int opt_nlocales = MAX_THREADS;
// should all threads share the same set of locale objects instead
// of creating their own?
-int rw_opt_shared_locale;
+int opt_shared_locale;
/**************************************************************************/
@@ -162,7 +162,7 @@
std::ios_base::iostate state = std::ios_base::goodbit;
std::tm local;
- for (int i = 0; i != rw_opt_nloops; ++i) {
+ for (int i = 0; i != opt_nloops; ++i) {
// save the name of the locale
const MyTimeData& data = my_time_data [i % nlocales];
@@ -171,8 +171,8 @@
// facet from it and use it to format a random time value
// using a random conversion specifier
const std::locale loc =
- rw_opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ opt_shared_locale ? data.locale_
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet
@@ -420,7 +420,7 @@
#endif // _RWSTD_NO_WCHAR_T
- if (rw_opt_shared_locale)
+ if (opt_shared_locale)
data.locale_ = loc;
nlocales += 1;
@@ -431,7 +431,7 @@
"failed to create locale(%#s)", name);
}
- if (nlocales == maxinx || nlocales == std::size_t (rw_opt_nlocales))
+ if (nlocales == maxinx || nlocales == std::size_t (opt_nlocales))
break;
}
@@ -442,8 +442,8 @@
rw_info (0, 0, 0,
"testing std::time_get<charT> with %d thread%{?}s%{;}, "
"%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
- rw_opt_nthreads, 1 != rw_opt_nthreads,
- rw_opt_nloops, 1 != rw_opt_nloops,
+ opt_nthreads, 1 != opt_nthreads,
+ opt_nloops, 1 != opt_nloops,
nlocales, int (nlocales), "%#s", locales);
rw_info (0, 0, 0, "exercising std::time_get<char>");
@@ -453,11 +453,11 @@
// create and start a pool of threads and wait for them to finish
int result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
#ifndef _RWSTD_NO_WCHAR_T
@@ -468,11 +468,11 @@
// start a pool of threads to exercise wstring thread safety
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
// exercise both the char and the wchar_t specializations
// at the same time
@@ -485,11 +485,11 @@
// start a pool of threads to exercise wstring thread safety
result =
- rw_thread_pool (0, std::size_t (rw_opt_nthreads), 0, thread_func, 0);
+ rw_thread_pool (0, std::size_t (opt_nthreads), 0, thread_func, 0);
rw_error (result == 0, 0, __LINE__,
"rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
- rw_opt_nthreads, thread_func);
+ opt_nthreads, thread_func);
#endif // _RWSTD_NO_WCHAR_T
@@ -504,9 +504,9 @@
// set nthreads to the greater of the number of processors
// and 2 (for uniprocessor systems) by default
- rw_opt_nthreads = rw_get_cpus ();
- if (rw_opt_nthreads < 2)
- rw_opt_nthreads = 2;
+ opt_nthreads = rw_get_cpus ();
+ if (opt_nthreads < 2)
+ opt_nthreads = 2;
#endif // _RWSTD_REENTRANT
@@ -518,10 +518,10 @@
"|-nlocales#0 " // arg must be non-negative
"|-locales= " // must be provided
"|-shared-locale# ",
- &rw_opt_nloops,
+ &opt_nloops,
int (MAX_THREADS),
- &rw_opt_nthreads,
- &rw_opt_nlocales,
+ &opt_nthreads,
+ &opt_nlocales,
&rw_opt_setlocales,
- &rw_opt_shared_locale);
+ &opt_shared_locale);
}
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp?rev=654561&r1=654560&r2=654561&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp Thu May 8 08:42:36 2008
@@ -165,7 +165,7 @@
// using a random conversion specifier
const std::locale loc =
opt_shared_locale ? data.locale_
- : std::locale (data.locale_name_);
+ : std::locale (data.locale_name_);
if (test_char) {
// exercise the narrow char specialization of the facet