diff options
Diffstat (limited to 'tests/test-mbrtowc-w32.c')
-rw-r--r-- | tests/test-mbrtowc-w32.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/test-mbrtowc-w32.c b/tests/test-mbrtowc-w32.c index f637330..99111e8 100644 --- a/tests/test-mbrtowc-w32.c +++ b/tests/test-mbrtowc-w32.c @@ -1,5 +1,5 @@ /* Test of conversion of multibyte character to wide character. - Copyright (C) 2008-2016 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> @@ -325,14 +325,12 @@ test_one_locale (const char *name, int codepage) memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == 0x30FB)); } return 0; @@ -397,14 +395,12 @@ test_one_locale (const char *name, int codepage) memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?')); } return 0; @@ -469,14 +465,12 @@ test_one_locale (const char *name, int codepage) memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2); memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */ - ASSERT (ret == (size_t)-1); - ASSERT (errno == EILSEQ); + ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?')); } return 0; |