8a46cf0fcf82b8c76e05be7e066ec854f974603a |
|
26-Aug-2014 |
Wally Yau <wyau@google.com> |
call uselocale() before freelocale() to make sure that g_local_key has a 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. Bug: 17299565 Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
|
6035e6cc8317600c3100fdf1070890c3e42715a7 |
|
30-Jul-2014 |
Dan Albert <danalbert@google.com> |
Proper MB_CUR_MAX. 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 (cherry picked from commit 1aec7c1a35b2d03038b194967d5ebdc8e2c24b80)
|
8e613cf342b369f7985135dbe11ebdbf8c736157 |
|
11-Jun-2014 |
Dan Albert <danalbert@google.com> |
Remove declaration for putw(3)/getw(3). These were both removed from POSIX 2004, and we don't define an implementation for getw(3). Keep the definition of put(3) on LP32 for binary compatibility. Bug: 13935372 Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56
|
3b9da0f99a6629d5283844922327711c985c78eb |
|
06-Jun-2014 |
Elliott Hughes <enh@google.com> |
Fix the printf family for non-ASCII. 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 (cherry picked from commit 69f05d291d848de654c72e5278de8ca06fbf5d2f) Change-Id: Ia5467e22ccb022e8d118de82291916050656147e
|
69f05d291d848de654c72e5278de8ca06fbf5d2f |
|
06-Jun-2014 |
Elliott Hughes <enh@google.com> |
Fix the printf family for non-ASCII. 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
|
9e01ea63a7517fe0c811ced3b822cf6e855ee62b |
|
29-May-2014 |
Christopher Ferris <cferris@google.com> |
Fix dprintf test. Change-Id: Ied783d545b6a35a70a158249f3957a9d00971627
|
6afb2a9a9729bbfd70ace602342b0173f3bad328 |
|
22-May-2014 |
Calin Juravle <calin@google.com> |
Add dprintf test Change-Id: I0fe1b4d45c1312cf01deed6ce5db032d5513e908
|
9b95ea936a72532c3124963312d348c6ee453d78 |
|
14-May-2014 |
Calin Juravle <calin@google.com> |
Document a known test issue in stdio_test.cpp. Bug: 13077905 Change-Id: Iab7fc7be0737c732e26cc07ecd7884b3087b51bb
|
c9244bdac1ae254bdbb9687da9cdbb4c3f4cb432 |
|
14-May-2014 |
Elliott Hughes <enh@google.com> |
Add tests for fprintf behavior when the underlying fd is bad. Bug: 7229520 Change-Id: Ie878e0c13fdcda7b9131fa56208b84ed88125be7
|
e77f38f14a01be7d0e1f2ca055047579ec42ffb7 |
|
14-May-2014 |
Elliott Hughes <enh@google.com> |
Add a unit test for already-fixed printf -0.0 formatting. This was fixed by the upgrade to upstream head. Bug: 5084292 Change-Id: Ia3bda1c0bbe38f428e22213b8bdbdf1a16caccf2
|
063525c61d24776094d76971f33920e2a2079530 |
|
13-May-2014 |
Elliott Hughes <enh@google.com> |
Consistently use #if defined(__BIONIC__) in tests. 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
|
03e4ebee8d1579fbbc6157c1e9be4537bcad0c62 |
|
08-May-2014 |
Calin Juravle <calin@google.com> |
Add fpos_t tests. Bug: 13077905 Change-Id: I86bb0ee95660f69f9971231c6f828a3a067d1ac8
|
20f8aec8976b17ad4d9da6be265594d924f368e1 |
|
13-May-2014 |
Elliott Hughes <enh@google.com> |
Fix use-after-free errors in stdio_test. fclose(3) frees the passed-in FILE*. We should close(2) the underlying fd, not fclose(3) the stream, if we want to test what happens with a stream we can't read from. Bug: 14466691 Change-Id: I99fed5904b0266b9c6ae05d0b9cf2e926446c064
|
e2341d08fa4a4e0c22056c410fd34d3f93e06017 |
|
03-May-2014 |
Elliott Hughes <enh@google.com> |
Disable %n in printf and vfwprintf. Bug: 14492135 Change-Id: If190bede29e5f68a65043ddbe8e878c660933d03
|
53b24382f5299931af5d08c933a765334a092c56 |
|
03-May-2014 |
Elliott Hughes <enh@google.com> |
Switch to current upstream OpenBSD wsetup.c. Change-Id: I2c1123f3e1d3c4af7fd7bf354e763934a39b78c0
|
0549371bd74ba7c7a5a16c2a7d6cc17dbe0e6f97 |
|
18-Apr-2014 |
Elliott Hughes <enh@google.com> |
Upgrade to current vfprintf. This gets us various bug fixes and missing C99 functionality. Bug: https://code.google.com/p/android/issues/detail?id=64886 Change-Id: Ie9f8ac569e9b5eec1e4a1faacfe2c21662eaf895
|
4bd97cee28dd815fff54fc97560be60d566c1fa5 |
|
11-Apr-2014 |
Elliott Hughes <enh@google.com> |
Switch to gdtoa. This gives us a real strtold for LP64 and fixes various LP64 bugs. Bug: 13563801 Change-Id: I277858d718ee746e136b6b6308a495ba50dfa488
|
7823f320b144bc95a34389e7ab709c9e4d3073e1 |
|
14-Apr-2014 |
Elliott Hughes <enh@google.com> |
Extra tests for printf of NaN and Inf. Change-Id: I61fc655d9777a03aabf38f6ebd047fe275386f05
|
edd7c2ec256548702d275b3023f54bd91b4dcfc4 |
|
01-Apr-2014 |
Alexander Ivchenko <alexander.ivchenko@intel.com> |
Fix the printf issue for 64 bits. The following case: printf("%1$s %1$s\n", "test"); would print garbage instead of the second "test". The problem is __find_arguments and the patch is a backport of two patches from OpenBSD that fix the issue: Author: tedu <tedu@cvs.openbsd.org> Date: Sat Apr 29 23:00:24 2006 +0000 check mmap for failure. the helper functions using it return -1, but callers do not yet check since printf() for example is not documented to return an error. some formatting cleanups. mostly ok deraadt millert Author: millert <millert@cvs.openbsd.org> Date: Fri May 16 14:28:54 2008 +0000 C99 says that for each va_copy() there must be a matching va_end(). Replace the non-portable hackery in __find_arguments() with a union. From FreeBSD. Change-Id: I6ea392ce6fcf4a319ae6a67ec58cc52fe7cbe534 Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
|
f171b34cf045115b82ccb89b57feb56d3cad472b |
|
18-Mar-2014 |
Christopher Ferris <cferris@google.com> |
Use the float/double assert macros. The normal ASSERT_EQ macros don't work quite right for float/double values, and result in false failures. Use the correct macros instead. Bug: 13511379 Change-Id: Ic2feee7f3d3569f57b6453b8fa95222846c625cd
|
603332fc4c2d073f0e197f9ce4517710e9b3a6d0 |
|
13-Mar-2014 |
Elliott Hughes <enh@google.com> |
Upgrade to current upstream scanf implementation. Also add a basic test. Change-Id: Icc0e68a5716b9579244f6eb8bac1ab5a24eda85a
|
f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d |
|
21-Dec-2013 |
Christopher Ferris <cferris@google.com> |
Make sure that the same tests are on all platforms. In order to be able to generate a list of tests for cts, the same set of tests must exist across all platforms. This CL adds empty tests where a test was conditionally compiled out. This CL creates a single library libBionicTests that includes all of the tests found in bionic-unit-tests-static. Also fix a few missing include files in some test files. Tested by running and compiling the tests for every platform and verifying the same number of tests are on each platform. Change-Id: I9989d4bfebb0f9c409a0ce7e87169299eac605a2
|
6ad8f76f1f1cbee484c30d723d9d6d1fcf5dc85c |
|
19-Dec-2013 |
Elliott Hughes <enh@google.com> |
Don't abort in stdio.getdelim_invalid and stdio.getline_invalid. Change-Id: Ie1aefed732f4bea77887bddd1be9a0578e247aa3
|
cbd85b9cc1c5dd0bb1a5691143cd5adcbecdba77 |
|
16-Nov-2013 |
Christopher Ferris <cferris@google.com> |
Modify tests for another glibc difference. It turns out that when passing a closed file to getdelim or getline, the functions in glibc will properly return a failure, but errno might not be set. Skip the errno check except on bionic. Change-Id: I8d625f15303d4c2d42e8d28491ea8a368aea4d32
|
13613137bc4266656bffce464e525eb9ae6371f0 |
|
28-Oct-2013 |
Christopher Ferris <cferris@google.com> |
Fix up failing glibc tests. There is a known bug running clone with the CLONE_VM flag, so for host create an empty test. Change the expected output of the stdio test for a glibc difference. Change the pause test to use ScopedSignalHandler to setup/restore the SIGALRM handler. After this, running bionic-unit-tests-glibc passes for all tests. Bug: 11389824 Change-Id: Ib304eae4164115835a54991dfdca5821ecc3db5e
|
925753aa1175ae58b24bbfe2d9e38eb4fe3f579d |
|
18-Oct-2013 |
Elliott Hughes <enh@google.com> |
Fix some test assumptions that are wrong for __LP64__. Change-Id: Ic79cd5858ceb611640a76bd03f3da4925d3150d9
|
6c7b3cb056509fd8756bc012878a499f6f102114 |
|
12-Oct-2013 |
Stephen Hines <srhines@google.com> |
Fix clang warnings in bionic. This fixes a few diverse issues that clang warns on in bionic. First, it specifies the appropriate converted types for format specifiers. The "h" and "hh" modifiers specify that the user is passing a short or char respectively. We were passing int deliberately in both cases and relying on the compiler to implicitly downcast to the smaller type. We also remove the non-standard "d" suffix from our double-precision floating point constant. This is an extension for gcc that clang does not implement. The third fix is to mark the c1 variable as unused, since it truly is neither read nor written. Change-Id: I4793352b9d3e58f1f4cac9e7581ef4b2a70b43c7
|
7248a2d4d03122efc55637ec77692fbc260b6e4f |
|
25-Sep-2013 |
Elliott Hughes <enh@google.com> |
Add a unit test for %n. Change-Id: I9335e089d66c98d34577f5e1d1a54b8f507b94f6
|
1d13c64d781a87dfa3f01e5c179bfa36748786af |
|
24-Sep-2013 |
Elliott Hughes <enh@google.com> |
Fix %hhd formats in the printf family. Found by adapting the simple unit tests for libc logging to test snprintf too. Fix taken from upstream OpenBSD without updating the rest of stdio. Change-Id: Ie339a8e9393a36080147aae4d6665118e5d93647
|
6b05c8e28017518fae04a3a601d0d245916561d2 |
|
11-Apr-2013 |
Elliott Hughes <enh@google.com> |
Start moving to current FreeBSD stdio. This only touches the easy stuff. Change-Id: Iecee57f1681dba5c56bff59f0e9a89811a71f0ca
|
b6e22482d4fbf62c23707a9096eecd2082a63ef1 |
|
09-Mar-2013 |
Elliott Hughes <enh@google.com> |
Let bionic use the correct definition of ssize_t. Bug: 8253769 Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
|
6b3f49a5374305ce9690c3c5ca2aadc90f54c521 |
|
07-Mar-2013 |
Elliott Hughes <enh@google.com> |
Upgrade to current NetBSD popen/pclose. This gets us back to using vfork now our ARM vfork assembler stub is fixed, and adds the missing thread safety for the 'pidlist'. Bug: 5335385 Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
|
730da15840c998319918da668defcf4a51410b12 |
|
28-Feb-2013 |
Elliott Hughes <enh@google.com> |
Avoid changing the C++ ABI with ssize_t. Bug: 8253769 Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
|
e255642dc1178663860104d9da2590056fae8d0b |
|
28-Feb-2013 |
Elliott Hughes <enh@google.com> |
Avoid changing the C++ ABI with ssize_t. Bug: 8253769 Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
|
c641cafbc387849510d7f408e85f72fa3608916d |
|
17-Feb-2013 |
Thorsten Glaser <tg@mirbsd.org> |
use architecture-specific ssize_t definition after change 32822 was rejected, this is the more light-weight version of the fix: libc/include/sys/types.h already - via libc/kernel/common/linux/posix_types.h - includes a definition of __kernel_ssize_t from libc/kernel/arch-*/asm/posix_types.h which is architecture-specific, toolchain-agnostic and also gets rid of the gcc -Wformat warning (which it issues correctly, since this i̲s̲ indeed a bug in bionic) Change-Id: Ie4503ab16628bc25815a836d07556f665e9795c7
|
5e3fc43ddeada547a155c6f561a12ff0b16e02d3 |
|
12-Feb-2013 |
Elliott Hughes <enh@google.com> |
Fix __pthread_clone on ARM to set errno on failure. MIPS and x86 appear to have been correct already. (Also fix unit tests that ASSERT_EQ with errno so that the arguments are in the retarded junit order.) Bug: 3461078 Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
|
eac9eb462ed6f7fcfb791e7a08b4011fcca47829 |
|
08-Sep-2012 |
Irina Tirdea <irina.tirdea@intel.com> |
Add getdelim(3) and getline(3) to bionic Some userspace programs (e.g. perf) need getline. Changes: () add getdelim.c, getline.c from NetBSD (http://netbsd.org/) under the NetBSD Foundation's (TNF) license ("2 clause" Berkeley-style license). () add stub for reentrant.h header that is needed by getdelim.c () add tests for getdelim(3) and getline(3). () update NOTICE file. Change-Id: I22ed82dd5904b9d7a3695535c04f502be3c27c5d Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
|
91875dcd6e17b7f3b251efe9b236b905ef414dde |
|
25-Sep-2012 |
Elliott Hughes <enh@google.com> |
Fix tmpfile(3). This could be better, but at least now it works. Change-Id: I88b7cf3f7ce8e5fa0b3fe678b7d1679a68ffffc9
|