stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: rewrite of 22.locale.ctype test
Date Fri, 06 Apr 2007 21:42:13 GMT
Scott Zhong wrote:
> Narrow uses widen as input to test on with each different locales.

Then let's keep them both in 22.locale.ctype.narrow for now
and split it up later.

> I
> assume tolower does the same.

It doesn't. There are two loops, each testing one function
with no dependency on the other.

Martin

> I think separating narrow.widen into two
> separate test is not the most efficient method.
> 
> Yu (Scott) Zhong
> 
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, April 06, 2007 1:54 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: rewrite of 22.locale.ctype test
> 
> Scott Zhong wrote:
>> As I had discuss with you Martin, rewrite the 22.locale.ctype test
> into
>> smaller subtests with both char and wchar_t:
>>
>> 22.locale.ctype.is.ch
> 
> I'm not sure exactly what the difference is between test_is() and
> test_is_ch() but the names are close enough that the tests should
> probably be done in the same program. (The names of the tests are
> chosen to match clauses in the standard wherever such clauses
> exist.)
> 
>> 22.locale.ctype.toupper.tolower
>> 22.locale.ctype.narrow.widen
>> 22.locale.ctype.is
>> 22.locale.ctype.scan
> 
> This looks reasonable, except that I would also split up toupper
> and tolower, and narrow and widen into tests of their own. Each
> test can exercise both char and wchar_t as we usually do (look
> at the string tests for examples). There should be a command
> line option to enable/disable each specialization.
> 
> If there's a lot of code that all the tests end up having in
> common it should go in a common header (perhaps rw_ctype.h)
> and source file (e.g., tests/src/ctype.cpp).
> 
>> Or would you like to further separate char and wchar_t into two
> separate
>> test? E.g. 22.locale.ctype.is.ch.char and
> 22.locale.ctype.is.ch.wchar.t.
> 
> This wouldn't be a bad idea if we were starting to write a new
> test suite but since none of our other tests is structured this
> way I wouldn't do it for ctype either.
> 
> Martin


Mime
View raw message