summaryrefslogtreecommitdiffstats
path: root/tests/libc_logging_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use vsnprintf(3) in syslog(3).Elliott Hughes2014-07-281-11/+0
| | | | | | | | | | | | | It seemed like a clever trick to use the internal log message formatting code in syslog(3), but on reflection that means you can't (for example) format floating point numbers. This patch switches us over to using good old vsnprintf(3), even though that requires us to jump through a few hoops. There's no obvious way to unit test this, so I wrote a little program and ran that. Bug: 14292866 Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
* Rewrite syslog(3) to use Android logging.Elliott Hughes2014-07-211-0/+11
| | | | | | | | | | | | Since we don't have syslogd on Android and you can't run one on a non-rooted device, it's more useful if syslog output just goes to the regular Android logging system. Bug: 14292866 (cherry picked from commit 3ad8ecb64e9dd5614169232b84a93eb3b8aa32d7) Change-Id: I3038855ca4f22532bf6d2c45d3f8028b866975f9
* Make sure that the same tests are on all platforms.Christopher Ferris2014-02-061-4/+29
| | | | | | | | | | | | | | | | 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
* Fix some test assumptions that are wrong for __LP64__.Elliott Hughes2013-10-181-0/+8
| | | | Change-Id: Ic79cd5858ceb611640a76bd03f3da4925d3150d9
* Fix clang warnings in bionic.Stephen Hines2013-10-111-2/+2
| | | | | | | | | | | | | | 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
* Clean up internal libc logging.Elliott Hughes2013-03-151-0/+145
We only need one logging API, and I prefer the one that does no allocation and is thus safe to use in any context. Also use O_CLOEXEC when opening the /dev/log files. Move everything logging-related into one header file. Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58