[v5,11/13] string: Add strerror_l on test-strerror-errno

Message ID 20200619134352.297146-11-adhemerval.zanella@linaro.org
State Committed
Headers
Series [v5,01/13] signal: Add signum-{generic,arch}.h |

Commit Message

Adhemerval Zanella June 19, 2020, 1:43 p.m. UTC
  Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
and s390x-linux-gnu.
---
 string/test-strerror-errno.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Carlos O'Donell July 2, 2020, 8:05 p.m. UTC | #1
On 6/19/20 9:43 AM, Adhemerval Zanella wrote:
> Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
> and s390x-linux-gnu.

OK for master.

No regression on x86_64 and i686.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  string/test-strerror-errno.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/string/test-strerror-errno.c b/string/test-strerror-errno.c
> index 0c52561015..f3b1a98d22 100644
> --- a/string/test-strerror-errno.c
> +++ b/string/test-strerror-errno.c
> @@ -55,6 +55,11 @@ do_test (void)
>    (void) msg;
>    TEST_COMPARE (errno, 0);
>  
> +  locale_t l = xnewlocale (LC_ALL_MASK, "C", NULL);
> +  msg = strerror_l (-3, l);
> +  (void) msg;
> +  TEST_COMPARE (errno, 0);

OK, make new locale, then translate with strerror_l for an invalid errnum
and make sure errno is unchanged.

> +
>    return 0;
>  }
>  
>
  

Patch

diff --git a/string/test-strerror-errno.c b/string/test-strerror-errno.c
index 0c52561015..f3b1a98d22 100644
--- a/string/test-strerror-errno.c
+++ b/string/test-strerror-errno.c
@@ -55,6 +55,11 @@  do_test (void)
   (void) msg;
   TEST_COMPARE (errno, 0);
 
+  locale_t l = xnewlocale (LC_ALL_MASK, "C", NULL);
+  msg = strerror_l (-3, l);
+  (void) msg;
+  TEST_COMPARE (errno, 0);
+
   return 0;
 }