summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix fortify compilation test in x86_64.Yabin Cui2015-03-051-2/+2
| | | | Change-Id: Ic243f6583e4f435899d01c7845dddacacbfc916e
* Fix fortify compilation test on x86.Yabin Cui2015-03-041-2/+2
| | | | Change-Id: I9b88cbcec51b6f1dbac2780a9bf82851bd6cc87c
* Fix fortify compilation test on mips.Yabin Cui2015-03-041-5/+5
| | | | Change-Id: Icff5b859ae58067bfa34430d3f5684335fe063b4
* Merge "Switch pthread_rwlock_t to stdatomic."Yabin Cui2015-03-051-0/+75
|\
| * Switch pthread_rwlock_t to stdatomic.Yabin Cui2015-03-041-0/+75
| | | | | | | | | | Bug: 19099838 Change-Id: Ie82967a60b5cec61a8bdd1e0e4a03738d01944f8
* | Add fortify compile test.Yabin Cui2015-03-041-6/+181
| | | | | | | | | | | | | | | | | | Two parts of tests are added: 1. Compile time warnings for gcc checking built-in functions. 2. Compile time errors for each errordecl() in bionic. Bug: 19234260 Change-Id: Iec6e4a8070c36815574fe9e0af9595d6143a4757
* | Fix fread returning bad data.Christopher Ferris2015-02-271-0/+38
| | | | | | | | | | Bug: 19172514 Change-Id: I05016577858a02aca7d14e75e6ec28abc925037c
* | Make bionic gtest main be compatible with gtest output format for cts test.Yabin Cui2015-02-262-4/+49
| | | | | | | | | | Bug: 17589740 Change-Id: Ifab521da379a33bf0a7bf11c21386f936f0d494c
* | Make all output of child test go to parent process in gtest_main.Yabin Cui2015-02-241-34/+17
| | | | | | | | Change-Id: Iad460e89755051cdb99593cbf42c97d9a359f32b
* | Fix "faccessat ignores flags"Nick Kralevich2015-02-241-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel system call faccessat() does not have any flags arguments, so passing flags to the kernel is currently ignored. Fix the kernel system call so that no flags argument is passed in. Ensure that we don't support AT_SYMLINK_NOFOLLOW. This non-POSIX (http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html) flag is a glibc extension, and has non-intuitive, error prone behavior. For example, consider the following code: symlink("foo.is.dangling", "foo"); if (faccessat(AT_FDCWD, "foo", R_OK, AT_SYMLINK_NOFOLLOW) == 0) { int fd = openat(AT_FDCWD, "foo", O_RDONLY | O_NOFOLLOW); } The faccessat() call in glibc will return true, but an attempt to open the dangling symlink will end up failing. GLIBC documents this as returning the access mode of the symlink itself, which will always return true for any symlink on Linux. Some further discussions of this are at: * http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003617.html * http://permalink.gmane.org/gmane.linux.lib.musl.general/6952 AT_SYMLINK_NOFOLLOW seems broken by design. I suspect this is why this function was never added to POSIX. (note that "access" is pretty much broken by design too, since it introduces a race condition between check and action). We shouldn't support this until it's clearly documented by POSIX or we can have it produce intuitive results. Don't support AT_EACCESS for now. Implementing it is complicated, and pretty much useless on Android, since we don't have setuid binaries. See http://git.musl-libc.org/cgit/musl/commit/?id=0a05eace163cee9b08571d2ff9d90f5e82d9c228 for how an implementation might look. Bug: 18867827 Change-Id: I25b86c5020f3152ffa3ac3047f6c4152908d0e04
* | Fix dup2 in the case where the two fds are equal.Elliott Hughes2015-02-231-0/+19
| | | | | | | | | | | | | | dup3's behavior differs from dup2 in this case, so we need to paper over that in the C library. Change-Id: I313cd6f226db5e237f61866f324c5ecdd12bf762
* | Add GNU extensions mempcpy and wmemcpy.Elliott Hughes2015-02-182-0/+10
| | | | | | | | | | | | | | Used by elfutils. On the bright side, they stopped using __mempcpy. Bug: 18374026 Change-Id: Id29bbe6ef1c5ed5a171bb6c32182f129d8332abb
* | Merge "Accuracy tests for libm"Christopher Ferris2015-02-17100-16/+180847
|\ \
| * | Accuracy tests for libmJingwei Zhang2015-02-14100-16/+180847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds more tests for math functions to address coverage issue of math functions discussed in: https://android-review.googlesource.com/#/c/49653/ https://android-review.googlesource.com/#/c/94780/ These are data sets used in regression tests for the Intel the math library (libm). They were collected over a long period of testing various libm implementations. The data sets contain function specific data (special and corner cases such as +/-0, maximum/minimum normalized numbers, +/-infinity, QNaN/SNaN, maximum/minimum denormal numbers, arguments that would produce close to overflow/underflow results, known hard-to-round cases, etc), implementation specific data (arguments close to table look-up values for different polynomial approximations, worst cases for range reduction algorithms) and other data with interesting bit patterns. The reference values are computed with Maple and were converted into hexadecimal format. Change-Id: I7177c282937369eae98f25d02134e4fc3beadde8 Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com> Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
* | | Merge "Fix memchr overflow."Elliott Hughes2015-02-171-0/+10
|\ \ \
| * | | Fix memchr overflow.Elliott Hughes2015-02-141-0/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The overflow's actually in the generic C implementation of memchr. While I'm here, let's switch our generic memrchr to the OpenBSD version too. Bug: https://code.google.com/p/android/issues/detail?id=147048 Change-Id: I296ae06a1ee196d2c77c95a22f11ee4d658962da
* | | 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
* | Fix our ftw tests.Elliott Hughes2015-02-101-15/+42
|/ | | | | | | | | | | | SELinux denies access to some files in /sys, so we can't just trawl through that asserting general truths. Instead, create a small known tree. Sadly neither ftw nor nftw takes user callback data, otherwise it would be nice to assert that we visit all the expected nodes. Bug: 19252748 Change-Id: Ib5309c38aaef53e6030281191a265a8d5a619044
* Display errors instead of running infinitely.Christopher Ferris2015-02-061-17/+27
| | | | | | | | When there is an error detected, the code runs forever and then times out without any indication of what happened. Change it so that error messages are printed and the test fails. Change-Id: Id3160fc2f394984de0157356594fd8b40de66b4a
* Add path separator in bionic-unit-tests program path.Yabin Cui2015-02-051-0/+21
| | | | | Bug: 19220800 Change-Id: I4245b1270363544cd5f083fe7ea7d9b11b46cdc0
* Merge "Add signal handling in bionic gtest main."Yabin Cui2015-02-051-136/+235
|\
| * Add signal handling in bionic gtest main.Yabin Cui2015-02-041-136/+235
| | | | | | | | | | | | | | | | | | The two bugs are very closely related and code amount is very small, So I think they may be fixed in one change. Bug: 19128558 Bug: 19129994 Change-Id: I44a35398e64dfca7e9676428cb8f4026e8f6e488
* | Merge "Fix poll/ppoll fortify test to avoid hanging in failed fortify clang ↵Yabin Cui2015-02-051-2/+7
|\ \ | | | | | | | | | test."
| * | Fix poll/ppoll fortify test to avoid hanging in failed fortify clang test.Yabin Cui2015-02-041-2/+7
| |/ | | | | | | | | Bug: 19220800 Change-Id: Ie75c640183c4a41a499556fefb4f824a134a5fb1
* | Merge "Add test about pthread_mutex_t owner tid limit."Yabin Cui2015-02-031-0/+12
|\ \ | |/ |/|
| * Add test about pthread_mutex_t owner tid limit.Yabin Cui2015-02-031-0/+12
| | | | | | | | | | Bug: 19216648 Change-Id: I7b12955bdcad31c13bf8ec2740ff88ba15223ec0
* | Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support"Nick Kralevich2015-02-021-0/+124
|\ \
| * | Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH supportNick Kralevich2015-02-021-0/+124
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many libc functions have an option to not follow symbolic links. This is useful to avoid security sensitive code from inadvertantly following attacker supplied symlinks and taking inappropriate action on files it shouldn't. For example, open() has O_NOFOLLOW, chown() has lchown(), stat() has lstat(), etc. There is no such equivalent function for chmod(), such as lchmod(). To address this, POSIX introduced fchmodat(AT_SYMLINK_NOFOLLOW), which is intended to provide a way to perform a chmod operation which doesn't follow symlinks. Currently, the Linux kernel doesn't implement AT_SYMLINK_NOFOLLOW. In GLIBC, attempting to use the AT_SYMLINK_NOFOLLOW flag causes fchmodat to return ENOTSUP. Details are in "man fchmodat". Bionic currently differs from GLIBC in that AT_SYMLINK_NOFOLLOW is silently ignored and treated as if the flag wasn't present. This patch provides a userspace implementation of AT_SYMLINK_NOFOLLOW for bionic. Using open(O_PATH | O_NOFOLLOW), we can provide a way to atomically change the permissions on files without worrying about race conditions. As part of this change, we add support for fchmod on O_PATH file descriptors, because it's relatively straight forward and could be useful in the future. The basic idea behind this implementation comes from https://sourceware.org/bugzilla/show_bug.cgi?id=14578 , specifically comment #10. Change-Id: I1eba0cdb2c509d9193ceecf28f13118188a3cfa7
* | Explicitly check that the reason fortify tests abort is fortify.Elliott Hughes2015-02-021-73/+65
| | | | | | | | Change-Id: I95291e2febf7b497c1d9f37fd7fa9acdd21e86a4
* | Fortify poll and ppoll.Elliott Hughes2015-02-021-9/+13
| | | | | | | | | | | | | | And remove the test for FD_ZERO fortification, which never made much sense anyway. Change-Id: Id1009c5298d461fa4722189e8ecaf22f0c529536
* | Add the fortify tests back into the glibc tests.Elliott Hughes2015-01-311-0/+1
|/ | | | Change-Id: I4426d0c7c1bfe3b0028a674f72d1c3b9d883d6af
* Add --gtest-filter as synonym for --gtest_filter in bionic gtest main.Yabin Cui2015-01-281-0/+13
| | | | | Bug: 19130480 Change-Id: I0d3df70ee8f692581cc4b9b742c5f347259fd0d2
* Merge "Fix parse of gtest_filter in bionic gtest main."Yabin Cui2015-01-271-1/+6
|\
| * Fix parse of gtest_filter in bionic gtest main.Yabin Cui2015-01-271-1/+6
| | | | | | | | | | Bug: 19130330 Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77
* | Merge "Add a test for float registers across setjmp/logjmp."Elliott Hughes2015-01-271-0/+51
|\ \ | |/ |/|
| * Add a test for float registers across setjmp/logjmp.Elliott Hughes2015-01-261-0/+51
| | | | | | | | Change-Id: I17cc056b185755e0b91de096b5ceefee4f4e0b3a
* | Rename "TIMEWARN" to "SLOW" in bionic gtest.Yabin Cui2015-01-261-17/+17
|/ | | | | Bug: 19109188. Change-Id: Idfe769ac652bf37642da24e4abb6061ca861d57e
* Merge "Support --gtest_ouput option in bionic gtest main."Yabin Cui2015-01-271-210/+402
|\
| * Support --gtest_ouput option in bionic gtest main.Yabin Cui2015-01-261-210/+402
| | | | | | | | | | Bug: 19109500 Change-Id: Ib18f90ad522e66ea62dd4e02e314585d9b36e15f
* | Merge "Add <error.h>."Elliott Hughes2015-01-262-0/+73
|\ \
| * | Add <error.h>.Elliott Hughes2015-01-262-0/+73
| | | | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=79170 Change-Id: Id91765fac45124545e2674a5b2c814707c1a448b
* | | Remove obsolete BUILD_TINY_ANDROID.Elliott Hughes2015-01-241-3/+0
|/ / | | | | | | Change-Id: If2fc97134340fd09ec2583b666ace2f673cbdf66
* | Fix optimized fread.Elliott Hughes2015-01-241-1/+55
| | | | | | | | | | | | | | | | gcov does writes after reads on the same stream, but the bulk read optimization was clobbering the FILE _flags, causing fwrite to fail. Bug: 19129055 Change-Id: I9650cb7de4bb173a706b502406266ed0d2b654d7
* | Merge "Minimize calls to mprotect"Dmitriy Ivanov2015-01-243-0/+63
|\ \
| * | Minimize calls to mprotectDmitriy Ivanov2015-01-233-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement refcounter based data protection guard to avoid unnecessary calls to mprotect when dlopen/dlclose is called from a constructor. Bug: 19124318 Big: 7941716 Change-Id: Id221b84ce75443094f99756dc9950b0a1dc87222
* | | Allow make to set a timeout for the host tests.Dan Albert2015-01-231-0/+5
|/ / | | | | | | Change-Id: Icc2ebf64bd1da1687bf313fe7a5640155c5795d8
* | There's no such thing as LOCAL_CXXFLAGS.Elliott Hughes2015-01-221-2/+2
| | | | | | | | Change-Id: Iad70e6bd4cb7cec9e0ece500a540e4dadc83d92e
* | Fix the stdio.fread_EOF test.Elliott Hughes2015-01-221-7/+8
| | | | | | | | | | | | | | | | | | | | Another sizeof/strlen screwup caused by trying to be too clever. Use std::string instead. Also fix all the ASSERT_STREQ calls in this file that had the arguments the right^Wwrong way round. If I ever see Kent Beck... Change-Id: I47a1bdfee99cf4e7bed9b398f3158a308fbcf1e8
* | Fix fread_EOF test name.Elliott Hughes2015-01-221-1/+1
|/ | | | Change-Id: I53a7f1428fd27c0b2a5c80f2e8af4845d17f5b4b
* Implement __fsetlocking.Elliott Hughes2015-01-211-1/+4
| | | | | | | | | | | | The old __isthreaded hack was never very useful on Android because all user code runs in a VM where there are lots of threads running. But __fsetlocking lets a caller say "I'll worry about the locking for this FILE*", which is useful for the normal case where you don't share a FILE* between threads so you don't need any locking. Bug: 17154740 Bug: 18593728 Change-Id: I2a8dddc29d3edff39a3d7d793387f2253608a68d