You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2008/04/15 17:05:41 UTC

Re: svn commit: r648131 - in /stdcxx/trunk/tests: localization/ strings/

faridz@apache.org wrote:
> Author: faridz
> Date: Mon Apr 14 23:51:12 2008
> New Revision: 648131
> 
> URL: http://svn.apache.org/viewvc?rev=648131&view=rev

Thanks for cleaning this up!

I wonder if it would make sense to enhance rw_printf() to check
and assert the correct alignment of the arguments to help us
detect at least some of these inconsistencies.

Opinions?

> Log:
> 2008-04-15 Farid Zaripov <fa...@epam.com>
> 
> 	* tests/localization/22.locale.codecvt.mt.cpp: Use %d format instead of %zu for printing
> 	the number of iterations to avoid printing the incorrect value on LLP64 platforms).
> 	* tests/localization/22.locale.cons.mt.cpp: Ditto.
> 	* tests/localization/22.locale.ctype.mt.cpp: Ditto.
> 	* tests/localization/22.locale.messages.mt.cpp: Ditto.
> 	* tests/localization/22.locale.money.get.mt.cpp: Ditto.
> 	* tests/localization/22.locale.money.put.mt.cpp: Ditto.
> 	* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
> 	* tests/localization/22.locale.num.get.mt.cpp: Ditto.
> 	* tests/localization/22.locale.num.put.mt.cpp: Ditto.
> 	* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
> 	* tests/localization/22.locale.statics.mt.cpp: Ditto.
> 	* tests/localization/22.locale.time.get.mt.cpp: Ditto.
> 	* tests/localization/22.locale.time.put.mt.cpp: Ditto.
> 	* tests/strings/21.string.cons.mt.cpp: Ditto.
> 	* tests/strings/21.string.push_back.mt.cpp: Ditto.
> 
> Modified:
>     stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp
>     stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp
>     stdcxx/trunk/tests/strings/21.string.cons.mt.cpp
>     stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.codecvt.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -481,7 +481,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::codecvt<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.cons.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -176,7 +176,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::locale ctors with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.ctype.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -248,7 +248,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::ctype<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.messages.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -246,7 +246,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::messages<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each",
> +             "%d iteration%{?}s%{;} each",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops);
>  
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.money.get.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -391,7 +391,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::money_get<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.money.put.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -397,7 +397,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::money_put<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.moneypunct.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -401,7 +401,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::moneypunct<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -474,7 +474,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::num_get<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.num.put.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -382,7 +382,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::num_put<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.numpunct.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -248,7 +248,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::numpunct<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.statics.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -153,7 +153,7 @@
>  
>          rw_info (0, 0, 0,
>                   "testing std::locale::global(const std::locale&) with "
> -                 "%d thread%{?}s%{;}, %zu iteration%{?}s%{;} each, in "
> +                 "%d thread%{?}s%{;}, %d iteration%{?}s%{;} each, in "
>                   "%zu locales { %{ .*A@} }",
>                   opt_nthreads, 1 != opt_nthreads,
>                   opt_nloops, 1 != opt_nloops,
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.time.get.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -441,7 +441,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::time_get<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp (original)
> +++ stdcxx/trunk/tests/localization/22.locale.time.put.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -319,7 +319,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::time_put<charT> with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
> +             "%d iteration%{?}s%{;} each, in %zu locales { %{ .*A@} }",
>               opt_nthreads, 1 != opt_nthreads,
>               opt_nloops, 1 != opt_nloops,
>               nlocales, int (nlocales), "%#s", locales);
> 
> Modified: stdcxx/trunk/tests/strings/21.string.cons.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/strings/21.string.cons.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/strings/21.string.cons.mt.cpp (original)
> +++ stdcxx/trunk/tests/strings/21.string.cons.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -189,7 +189,7 @@
>  {
>      rw_info (0, 0, 0,
>               "testing std::string with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each",
> +             "%d iteration%{?}s%{;} each",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops);
>  
> @@ -217,7 +217,7 @@
>  
>      rw_info (0, 0, 0,
>               "testing std::wstring with %d thread%{?}s%{;}, "
> -             "%zu iteration%{?}s%{;} each",
> +             "%d iteration%{?}s%{;} each",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops);
>  
> 
> Modified: stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp?rev=648131&r1=648130&r2=648131&view=diff
> ==============================================================================
> --- stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp (original)
> +++ stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp Mon Apr 14 23:51:12 2008
> @@ -110,7 +110,7 @@
>  static int
>  run_test (int, char**)
>  {
> -    rw_info (0, 0, 0, "running %d thread%{?}s%{;}, %zu iteration%{?}s%{;} each",
> +    rw_info (0, 0, 0, "running %d thread%{?}s%{;}, %d iteration%{?}s%{;} each",
>               rw_opt_nthreads, 1 != rw_opt_nthreads,
>               rw_opt_nloops, 1 != rw_opt_nloops);
>  
> 
> 


RE: svn commit: r648131 - in /stdcxx/trunk/tests: localization/ strings/

Posted by Eric Lemings <Er...@roguewave.com>.
 

> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, April 15, 2008 9:06 AM
> To: dev@stdcxx.apache.org
> Subject: Re: svn commit: r648131 - in /stdcxx/trunk/tests: 
> localization/ strings/
> 
> faridz@apache.org wrote:
> > Author: faridz
> > Date: Mon Apr 14 23:51:12 2008
> > New Revision: 648131
> > 
> > URL: http://svn.apache.org/viewvc?rev=648131&view=rev
> 
> Thanks for cleaning this up!
> 
> I wonder if it would make sense to enhance rw_printf() to check
> and assert the correct alignment of the arguments to help us
> detect at least some of these inconsistencies.
> 
> Opinions?

Most certainly.  I remember reading an old book called Writing
Solid Code and going to a lot of trouble to diagnose complex
usage semantics like this is usually well worth it especially
when there's really no documentation to guide correct usage.  :)

Brad.