summaryrefslogtreecommitdiffstats
path: root/tests/locale_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix newlocale with a NULL locale name.Elliott Hughes2014-11-041-4/+14
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=78567 Change-Id: I272dabc12ab186b44a525c7e8ac1846e62334e85
* call uselocale() before freelocale() to make sure that g_local_key has a ↵Wally Yau2014-08-271-1/+2
| | | | | | | | | | | | | | | | | | | valid locale. For tests that call uselocale(), the locale is stored in the g_userlocale_key thread-specific key. If freelocale() is called later, then g_uselocal_key points to a deleted pointer. CTS eventually calls vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX accesses the deleted locale stored in g_uselocale_key, causing unpredictable errors. Fixed the tests by calling uselocale() with the old locale before calling freelocale. (cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.) Bug: 17299565 Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
* Proper MB_CUR_MAX.Dan Albert2014-07-301-2/+19
| | | | | | | | | | Previously this was hard coded to 4. This is only the case for UTF-8 locales. As a side effect, this properly reports C.UTF-8 as the default locale instead of C. Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
* 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
* Flesh out <locale.h>.Elliott Hughes2014-04-081-0/+60
| | | | | | This is a trivial implementation that only supports the C/POSIX locale. Change-Id: Ib11cea4249e1862aca96a8b94d58ea9a418cbe75
* Clean up localeconv(3).Elliott Hughes2014-04-081-6/+25
| | | | | | | The OpenBSD doesn't support C99, and the extent to which we support locales is trivial, so just do it ourselves. Change-Id: If0a06e627ecc593f7b8ea3e9389365782e49b00e
* Add lconv declaration and localeconv(3)Pavel Chupin2014-03-281-0/+28
lconv is taken from ndk/sources/android/support/include/locale.h and matches bsd/glibc upstream. Keep old declaration for 32-bits for compatibility. localeconv.c and deps are taken from openbsd upstream. Changed strtod.c accordingly. Change-Id: I9fcc4d15f5674d192950d80edf26f36006cd31b4 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>