[PATCH] locale/tst-localedef-path-norm: Don't create $(complocaledir)
DJ Delorie
dj@redhat.com
Thu Apr 30 19:31:42 GMT 2020
"Carlos O'Donell" <carlos@redhat.com> writes:
> Given that we creat $(complocaledir) now we can cleanup an existing test
> and remove the xmkdirp for support_complocaledir_prefix.
>
> OK for master?
LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>
> - /* Create the needed directories:
> - - We need the default compiled locale dir for default output.
> - - We need an arbitrary absolute path for localedef output.
> -
> - Note: Writing to a non-default absolute path disables any kind
> + /* We need an arbitrary absolute path for localedef output.
> + Writing to a non-default absolute path disables any kind
ok
> exactly as they specified it. */
> - xmkdirp (support_complocaledir_prefix, 0777);
Makefile does this for us. Ok.
> - xmkdirp ("/output", 0777);
> +#define ABSDIR "/output"
> + xmkdirp (ABSDIR, 0777);
Same function, but parameterized. Ok. The rest of the patch "just"
uses this macro.
>
> /* Test 1: Expected normalization.
> - Run localedef and expect output in /usr/lib/locale/en_US1.utf8,
> + Run localedef and expect output in $(complocaledir)/en_US1.utf8,
Ok.
> /* Test 2: No normalization past '@'.
> - Run localedef and expect output in /usr/lib/locale/en_US2.utf8@tEsT,
> + Run localedef and expect output in $(complocaledir)/en_US2.utf8@tEsT,
Ok^2
> /* Test 3: No normalization past '@' despite period.
> - Run localedef and expect output in /usr/lib/locale/en_US3@tEsT.UTF-8,
> + Run localedef and expect output in $(complocaledir)/en_US3@tEsT.UTF-8,
Ok^3
> /* Test 4: Normalize numeric codeset by adding 'iso' prefix.
> - Run localedef and expect output in /usr/lib/locale/en_US4.88591,
> + Run localedef and expect output in $(complocaledir)/en_US4.88591,
Ok^4
> /* Test 5: Don't add 'iso' prefix if first char is alpha.
> - Run localedef and expect output in /usr/lib/locale/en_US5.a88591,
> + Run localedef and expect output in $(complocaledir)/en_US5.a88591,
Ok^5
> /* Test 6: Don't add 'iso' prefix if last char is alpha.
> - Run localedef and expect output in /usr/lib/locale/en_US6.88591a,
> + Run localedef and expect output in $(complocaledir)/en_US6.88591a,
Ok^6
> /* Test 7: Don't normalize anything with an absolute path.
> - Run localedef and expect output in /output/en_US7.UTF-8,
> + Run localedef and expect output in ABSDIR/en_US7.UTF-8,
Ok^7
> "-f", "UTF-8",
> - "/output/en_US7.UTF-8", NULL },
> + ABSDIR "/en_US7.UTF-8", NULL },
Ok.
> .exp = "en_US7.UTF-8",
> - .complocaledir = "/output"
> + .complocaledir = ABSDIR
Ok.
> /* Test 8: Don't normalize anything with an absolute path.
> - Run localedef and expect output in /output/en_US8.UTF-8@tEsT,
> + Run localedef and expect output in ABSDIR/en_US8.UTF-8@tEsT,
Ok^8
> "-f", "UTF-8",
> - "/output/en_US8.UTF-8@tEsT", NULL },
> + ABSDIR "/en_US8.UTF-8@tEsT", NULL },
Ok.
> .exp = "en_US8.UTF-8@tEsT",
> - .complocaledir = "/output"
> + .complocaledir = ABSDIR
Ok.
> /* Test 9: Don't normalize anything with an absolute path.
> - Run localedef and expect output in /output/en_US9@tEsT.UTF-8,
> + Run localedef and expect output in ABSDIR/en_US9@tEsT.UTF-8,
Ok^9
> "-f", "UTF-8",
> - "/output/en_US9@tEsT.UTF-8", NULL },
> + ABSDIR "/en_US9@tEsT.UTF-8", NULL },
Ok.
> .exp = "en_US9@tEsT.UTF-8",
> - .complocaledir = "/output"
> + .complocaledir = ABSDIR
Ok.
More information about the Libc-alpha
mailing list