[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: quotearg test
From: |
Eric Blake |
Subject: |
Re: quotearg test |
Date: |
Mon, 30 Jan 2012 10:25:20 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 01/28/2012 08:32 PM, Bruno Haible wrote:
> Hi Eric,
>
>> - POSIX [1] does not specify the character encoding of the "C" locale.
>> It could be US-ASCII or any extension of it, such as ISO-8859-1 or
>> UTF-8.
>> ...
>> Let's fix the testsuites.
>
> Here's a proposed patch for the testsuite failure currently seen on
> MacOS X 10.5:
>
> test-quotearg.h:53: assertion failed
> FAIL: test-quotearg-simple
>
> Eric, each time I have to dig into this test, I find it extremely
> hard to understand, because you need a debugger in order to see
> what strings are passed where. Without a debugger, just from looking
> at the source code, I have to grok the *entire* source code before I
> can understand anything.
That's a fair complaint.
> Concretely, this would mean
> - keep the function compare(),
> - change the function compare_strings to take 9 individual arguments
> instead of a 'struct result_strings *',
> - split it into two functions, one that corresponds to the case
> ascii_only==true, one for the case ascii_only==false.
> - in main(), invert the scope of the loops over the styles and over
> the data: Put the loop over different data elements outside the loop
> over the styles; otherwise it is impossible to add extra data only
> for one style but not for the others.
>
> What do you think about it?
Is that a patch you are willing to write, or are you asking me to do
this work? If the latter, then I will try to get to it this week.
Meanwhile,
>
>
> 2012-01-28 Bruno Haible <address@hidden>
>
> quotearg: Fix test failure on MacOS X 10.5.
> * tests/test-quotearg-simple.c: Include localcharset.h.
> (main): If the locale encoding is not ASCII, bypass the tests of
> locale_quoting_style and clocale_quoting_style.
I'm fine with applying this, as it is an improvement, even if it is not
as drastic as your overall idea for rewriting the test.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature