am 30659d4f: am cd79c8b1: Merge "Fix a wchar.wcstombs_wcrtombs test failure."

* commit '30659d4ff002b3c09cb1a5ae67b0d416afdf0383':
  Fix a wchar.wcstombs_wcrtombs test failure.
This commit is contained in:
Elliott Hughes 2014-04-18 21:56:16 +00:00 committed by Android Git Automerger
commit 439c774f44
2 changed files with 5 additions and 2 deletions
libc/bionic
tests

View File

@ -250,6 +250,9 @@ size_t wcsrtombs(char* dst, const wchar_t** src, size_t n, mbstate_t* /*ps*/) {
// TODO: UTF-8 support.
if ((*src)[i] > 0x7f) {
errno = EILSEQ;
if (dst != NULL) {
*src = &(*src)[i];
}
return static_cast<size_t>(-1);
}
if (dst != NULL) {

View File

@ -58,8 +58,8 @@ TEST(wchar, wctomb_wcrtomb) {
}
TEST(wchar, wcstombs_wcrtombs) {
wchar_t chars[] = { L'h', L'e', L'l', L'l', L'o', 0 };
wchar_t bad_chars[] = { L'h', L'i', 666, 0 };
const wchar_t chars[] = { L'h', L'e', L'l', L'l', L'o', 0 };
const wchar_t bad_chars[] = { L'h', L'i', 666, 0 };
const wchar_t* src;
char bytes[BUFSIZ];