[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: add program to detect locales
From: |
Jim Meyering |
Subject: |
Re: [PATCH] tests: add program to detect locales |
Date: |
Mon, 29 Mar 2010 09:59:06 +0200 |
Paolo Bonzini wrote:
> This should improve skipping euc-mb and sjis-mb tests when the locale is
> not supported. I'm hesitant to put it in NEWS because I didn't test
> it on e.g. Cygwin.
>
> It could be applied to other multibyte tests (fmbtest, char-class-multibyte)
> too.
Thanks!
This will be a much more reliable test.
> * tests/Makefile.am (check_PROGRAMS): Add get-mb-cur-max.
> * tests/get-mb-cur-max.c: New.
> * tests/euc-mb: Use it. Fail if the former detection test fails.
> * tests/sjis-mb: Use it. Fail if the former detection test fails.
...
> +int main(int argc, char **argv)
Unless you have a good reason, please format that slightly differently:
int
main (int argc, char **argv)
> +{
> + if (setlocale (LC_ALL, argv[1]))
> + {
> + printf ("%d\n", MB_CUR_MAX);
> + exit (0);
> + }
At first glance, it all seems fine, but it'd be nice if
you would repost a patch I can apply and test:
$ git am j
Applying: tests: add program to detect locales
fatal: corrupt patch at line 135
Patch failed at 0001 tests: add program to detect locales
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
[Exit 1]
$ patch -p1 < j
patching file tests/Makefile.am
patching file tests/euc-mb
patching file tests/get-mb-cur-max.c
patching file tests/sjis-mb
patch: **** malformed patch at line 155: @@ -26,14 +27,14 @@
test_grep_reject() {