aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wchar_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add GNU extensions mempcpy and wmemcpy.Elliott Hughes2015-02-181-0/+5
| | | | | | | Used by elfutils. On the bright side, they stopped using __mempcpy. Bug: 18374026 Change-Id: Id29bbe6ef1c5ed5a171bb6c32182f129d8332abb
* Regression test for NDK bug 80199.Elliott Hughes2015-02-141-0/+5
| | | | | | | | Bionic never had this bug, but since the proposed fix is to remove the NDK's broken code, we should add a regression test here. Bug: https://code.google.com/p/android/issues/detail?id=80199 Change-Id: I4de21b5da9913cef990bc4d05a7e27562a71a02b
* Add missing function prototypes wcpcpy/wcpncpy.Christopher Ferris2014-11-131-5/+75
| | | | | | Also add smoke tests for a few of the wchar functions. Change-Id: Id1be522f55a6708564d444941f42097548f16497
* Pull in upstream fixes to reject invalid bases.Elliott Hughes2014-09-231-0/+72
| | | | | | Also add tests to make sure the full set works correctly. Change-Id: I3e7f237f12c9c93e1185a97c9717803e7e55a73c
* Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.Elliott Hughes2014-08-201-0/+31
| | | | | Bug: 17164505 Change-Id: I59e28a08ff8b6ab632230b11a5807cfd5278aeb5
* Fix mbsrtowcs(3) src param for finished string.Dan Albert2014-07-311-1/+1
| | | | | | | A mistake I made while cleaning this up the first time through. mbstrtowcs(3) sets the src param to null if it finishes the string. Change-Id: I6263646e25d9537043b7025fd1dd6ae195f365e2
* Fix mbsrtowcs(3)'s handling of len parameter.Dan Albert2014-07-211-0/+11
| | | | | | | | | The len parameter is a _maximum_ length. The previous code was treating it as an exact length, causing the following typical call to fail: mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in) Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
* Fix the printf family for non-ASCII.Elliott Hughes2014-06-051-0/+29
| | | | | | | | | | The bug here turned out to be that we hadn't increased the constant corresponding to the maximum number of bytes in a character to match our new implementation, so any character requiring more than a byte in UTF-8 would break our printf family. Bug: 15439554 Change-Id: I693e5e6eb11c640b5886e848502908ec5fff53b1
* Removes wcswcs from bionic for LP64.Dan Albert2014-06-041-5/+1
| | | | | Bug: 13935372 Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
* Fix wmemmove test.Christopher Ferris2014-05-291-2/+2
| | | | | | I accidentally copied over the nul terminator with the test. Change-Id: I24a9aa05d4fba4f383fa38a3041bb6a6b179130c
* Add optimized AArch64 versions of bcopy and wmemmove based on memmoveBernhard Rosenkraenzer2014-05-231-0/+11
| | | | | | | | Add optimized versions of bcopy and wmemmove for AArch64 based on the memmove implementation Change-Id: I82fbe8a7221ce224c567ffcfed7a94a53640fca8 Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
* Revert "Add optimized AArch64 versions of bcopy and wmemmove based on memmove"Christopher Ferris2014-05-241-11/+0
| | | | | | | | This reverts commit 8167dd7cb98e87ffe9b40e4993c330b244ca2234. For some reason I thought the bcopy change was bzero. The bcopy code doesn't pass our tests, so reverting until I can figure out what's wrong. Change-Id: Id89fe959ea5105cd58dff6bba8d91a30cc4bcb07
* Add optimized AArch64 versions of bcopy and wmemmove based on memmoveBernhard Rosenkraenzer2014-05-231-0/+11
| | | | | | | | Add optimized versions of bcopy and wmemmove for AArch64 based on the memmove implementation Change-Id: Ie43d0ff4f8ec4edba5b4fb5ccacd941f81ac6557 Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
* Address additional warnings found by GCC 4.9.Ben Cheng2014-05-191-6/+6
| | | | Change-Id: If668a6eb98a6ce7b2872f528b8e3527638814f68
* Consistently use #if defined(__BIONIC__) in tests.Elliott Hughes2014-05-131-1/+1
| | | | | | | | I've also switched some tests to be positive rather than negative, because !defined is slightly harder to reason about and there are only two cases: bionic and glibc. Change-Id: I8d3ac40420ca5aead3e88c69cf293f267273c8ef
* Support mb sequences across calls to mb*to*wcs* functionsCalin Juravle2014-05-131-0/+108
| | | | | Bug: 13077905 Change-Id: I5abdc7cc3c27c109b7900c94b112f18a95c35763
* wchar_test.cpp: fix error between comparison signed and unsigned integerYongqin Liu2014-05-091-3/+3
| | | | | | | | | | | | when compile the cts package with aarch64 gcc4.9, will get following error: bionic/tests/wchar_test.cpp:253:3: required from here external/gtest/include/gtest/gtest.h:1448:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] this change fix it by using static_cast<wchar_t> as suggested by Calin Juravle Change-Id: I7fb9506e7b84b8a12b9d003458d4f0e78554c3cd Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
* Use the OpenBSD wcsftime.Elliott Hughes2014-05-021-0/+15
| | | | Change-Id: I81929355d245ba1e58b4a464ca6cf45915e0238e
* Fix wchar.cpp MIPS narrowing conversion build failure.Elliott Hughes2014-05-011-1/+1
| | | | Change-Id: Id9103c78958d60337dbdb807b11256c1b31c632a
* Switch to a working UTF-8 mb/wc implementation.Elliott Hughes2014-05-011-3/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | Although glibc gets by with an 8-byte mbstate_t, OpenBSD uses 12 bytes (of the 128 bytes it reserves!). We can actually implement UTF-8 encoding/decoding with a 0-byte mbstate_t which means we can make things work on LP32 too, as long as we accept the limitation that the caller needs to present us with a complete sequence before we'll process it. Our behavior is fine when going from characters to bytes; we just update the source wchar_t** to say how far through the input we got. I'll come back and use the 4 bytes we do have to cope with byte sequences split across multiple input buffers. The fact that we don't support UTF-8 sequences longer than 4 bytes plus the fact that the first byte of a UTF-8 sequence encodes the length means we shouldn't need the other fields OpenBSD used (at the cost of some recomputation in cases where a sequence is split across buffers). This patch also makes the minimal changes necessary to setlocale(3) to make us behave like glibc when an app requests UTF-8. (The difference being that our "C" locale is the same as our "C.UTF-8" locale.) Change-Id: Ied327a8c4643744b3611bf6bb005a9b389ba4c2f
* Switch to the OpenBSD wcsto* functions.Elliott Hughes2014-04-291-0/+54
| | | | | | | | | | | | | | | | | | This replaces a partial set of non-functional functions with a complete set of functions, all of which actually work. This requires us to implement mbsnrtowcs and wcsnrtombs which completes the set of what we need for libc++. The mbsnrtowcs is basically a copy & paste of wcsnrtombs, but I'm going to go straight to looking at using the OpenBSD UTF-8 implementation rather than keep polishing our home-grown turd. (This patch also opportunistically switches us over to upstream btowc, mbrlen, and wctob, since they're all trivially expressed in terms of other functions.) Change-Id: I0f81443840de0f1aa73b96f0b51988976793a323
* Add mbtowc and fix mbrtowc.Elliott Hughes2014-04-281-0/+38
| | | | Change-Id: I48786cd82587e61188d40f6fd6e11ac05e857ae9
* Replace our broken wcswcs with the working upstream one.Elliott Hughes2014-04-281-0/+15
| | | | Change-Id: I2952684df5674d10f0564d92c2cd42597725c0e3
* Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.Elliott Hughes2014-04-211-0/+4
| | | | | | GCC tells us everything we need to know. clang does its usual half-assed job. Change-Id: Id4d664529b10345274602768cd564d3df717e931
* Fix a wchar.wcstombs_wcrtombs test failure.Elliott Hughes2014-04-181-2/+2
| | | | | | Looks like I screwed up a last-minute refactor and didn't re-run the tests. Change-Id: I90a710ae66a313a9812859650aa0b4e8c6bc57f9
* Upgrade to current vfprintf.Elliott Hughes2014-04-171-0/+100
| | | | | | | This gets us various bug fixes and missing C99 functionality. Bug: https://code.google.com/p/android/issues/detail?id=64886 Change-Id: Ie9f8ac569e9b5eec1e4a1faacfe2c21662eaf895
* Implement wctomb(3) for ltrace.Elliott Hughes2014-04-071-0/+57
This is an implementation in the style of the rest: char == byte. We might want to come back and implement UTF-8, but this is enough for ltrace. Bug: 13747066 Change-Id: Ib2b63609c9014fdef9a8491e067467c4fc5ae3cc