stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: [PATCH] Update test to validate results
Date Wed, 08 Aug 2007 22:06:19 GMT
Travis Vitek wrote:
> Martin Sebor wrote:
>> A test failure should indicate that there is a problem with 
>> the library,
>> not that the environment system is not equipped to exercise it.
> Agreed.
>> When
>> there's only one locale installed on a system (the "C" locale must
>> always be present) that's not a problem we can do much about. All it
>> means is that we can't tell if the library would work correctly if
>> there were more than one locale. So I think in this case the test
>> should just run all threads in the "C" locale. It won't be a very
>> useful test but it'll be better than nothing, don't you agree?
> The only issue I would have is when the test is run manually. There
> is a command line argument to explicitly specify the locales to use,
> and if none of them are available I think I'd expect the test to exit
> immediately with an error.

You mean when the user specifies --locales="foo bar" and one or
more of them isn't available the test should give an error? Hmm,
I agree that we should give some indication that one (or more)
of the locales are unavailable in this case but think I would
still prefer a warning to a hard error, simply because I see no
harm in being robust (not every locale that /usr/bin/locale -a
spits out is valid, so having the test weed out the bad ones
can be useful when scripting things). Do you have a reason for
wanting it to be an error?

> I can live with defaulting to the C locale as long as there is a
> warning, which is already provided.
>> Btw., the locale thread safety tests currently only exercise the
>> implementation when using the native (libc) locales. There's a big
>> chunk of code that deals with our own locales that's not being
>> tested. At some point we'll need to enhance the tests to exercise
>> this functionality as well.
> I'm not sure what needs to be added for this enhancement. Could you
> name a test or two that does this, or point me to the APIs I need
> to be using?

The API is the same. The machinery is enabled automatically by
pointing the RWSTD_LOCALE_ROOT environment variable at the root
of the stdcxx locale database tree and referencing locales
installed under it by name (or pathname). Most of the locale
tests, including 22.locale.time.put.cpp, exercise both


View raw message