[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect buggy mbrtowc(3) implementations and skip tests

From: Jim Meyering
Subject: Re: Detect buggy mbrtowc(3) implementations and skip tests
Date: Tue, 5 Jul 2016 08:13:24 -0700

On Mon, Jul 4, 2016 at 7:28 PM, Assaf Gordon <address@hidden> wrote:
> Continuing from previous threads, the attached draft patch creates a new C 
> program to test mbrtowc(3) behavior,
> and adds test infrastructure to skip tests if needed.
> Comments welcomed,
>  - assaf
> P.S.
> The tests will be skipped and not fail, but this doesn't yet mean sed is 
> operating correctly on these systems. Perhaps a more long-term solution is to 
> detect bugs during configure and add gnulib's mbrtowc replacement.

Thank you!
Here's a fix-up patch. Please squash it into yours.
This ensures that the new .c file is formatted per GNU indent.
I've adjusted grammar/wording and fixed a typo or two in that long comment.
I've made the test program use error rather than fprintf (for more
reliable diagnosis of errors) and closeout (for robust handling of
write failure). Without the latter, running the following on a linux
system would result in a failed write system call, but no diagnostic
and an exit status of 0:

  $ echo a | testsuite/test-mbrtowc > /dev/full; echo $?

Sure, it's only a test program, but even they should set a good example.
In testsuite/init.cfg, I added the "local " prefix, so that each "n"
is scoped to its helper function.
In order to use the close_stdout function, I had to add "closeout" to
bootstrap.conf, which needs a changelog entry, and which ended up
modifying some derived .gitignor files and requiring the
po/ addition. Finally, in main, I moved a few declarations
down into the blocks in which they are used.

Attachment: 0001-.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]