php-src/ext/gettext/tests
Michael Orlitzky bfb0e367f2
ext/gettext/tests: fix libintl return values under musl
Musl has two quirks that are leading to failed internationalization
tests. First is that the return value of bindtextdomain(..., NULL)
will always be false, rather than an "implementation-defined default
directory," because musl does not have an implementation-defined
default directory. One test needs a special case for this.

Second is that the musl implementation of bind_textdomain_codeset()
always returns NULL. The POSIX-correctness of this is debatable, but
it is roughly equivalent to correct, because musl only support UTF-8,
so the NULL value indicating that the codeset is unchanged from the
locale's codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * https://github.com/php/doc-en/issues/4311
  * https://github.com/php/php-src/issues/17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH #13696
2024-12-19 18:26:35 +01:00
..
66265 added test for things done so far for bug #66265 2014-11-21 10:22:47 +01:00
locale Fix bug #70574: Move files to proper locale dir 2020-08-07 14:37:27 +02:00
44938.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug53251.phpt ext/gettext/tests: fix libintl return values under musl 2024-12-19 18:26:35 +01:00
bug66267.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
bug73730.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
dcgettext_lcall.phpt ext/gettext: dcgettext/dcngettext fix for stable branches. 2024-03-05 18:39:14 +00:00
dcngettext.phpt ext/gettext: dcgettext/dcngettext sigabrt on macOs. 2024-03-04 15:34:59 +00:00
gettext_basic-enus.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_basic.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_bind_textdomain_codeset-retval.phpt ext/gettext/tests: fix libintl return values under musl 2024-12-19 18:26:35 +01:00
gettext_bindtextdomain-cwd.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_bindtextdomain-emptydomain.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_bindtextdomain-path.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_dcgettext.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_dgettext.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_dngettext-plural.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_ngettext.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_phpinfo.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00
gettext_textdomain-retval.phpt Migrate SKIPIF -> EXTENSIONS (#7138) 2021-06-11 11:57:42 +02:00