incubator-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 [take 2]
Date Sun, 12 Aug 2007 23:01:19 GMT
Travis Vitek wrote:
> Attached is a patch to enhance the time_put facet mt test. Threads
> verify that the values they put compare equal to those put in the
> primary thread.

Now that I've committed the patch... I have a question about the bit
below that I noticed too late:

> @@ -160,19 +214,117 @@
>  static int
>  run_test (int, char**)
> +    const char* const possible_locale_options[] = {
> +        locale_list, "C\0", 0
> +    };

Is the purpose of this code to exercise the "C" locale in addition
to all the named locales returned from rw_locales()?

If so, it's a valuable enhancement to the test since the base facet
(i.e., time_put as opposed to time_put_byname) wasn't necessarily
being exercised by the test before this change. Good catch!

That said, I'm not quite happy with how this solution is "grafted"
on to the current general mechanism we use to obtain the list of
locales to test. First, the list of locales the test says (in the
call to rw_info()) it exercises doesn't include this locale. Second,
there's no way to disable it using the --locales option. Finally,
it's a chunk of code that will likely end up being repeated in all
the locale tests and so it's a perfect candidate for an enhancement
to the test driver.

What do you think about this: let's change rw_locales() to always
return a list of names that starts with "C". That way callers that
don't want to exercise the "C" locale can simply skip past it while
others will be guaranteed to exercise the classic locale.


View raw message