Commit graph

11 commits

Author SHA1 Message Date
Elliott Hughes
95646e6666 Add ASSERT_ERRNO and EXPECT_ERRNO (and use them).
We've talked about this many times in the past, but partners struggle to
understand "expected 38, got 22" in these contexts, and I always have to
go and check the header files just to be sure I'm sure.

I actually think the glibc geterrorname_np() function (which would
return "ENOSYS" rather than "Function not implemented") would be more
helpful, but I'll have to go and implement that first, and then come
back.

Being forced to go through all our errno assertions did also make me
want to use a more consistent style for our ENOSYS assertions in
particular --- there's a particularly readable idiom, and I'll also come
back and move more of those checks to the most readable idiom.

I've added a few missing `errno = 0`s before tests, and removed a few
stray `errno = 0`s from tests that don't actually make assertions about
errno, since I had to look at every single reference to errno anyway.

Test: treehugger
Change-Id: Iba7c56f2adc30288c3e00ade106635e515e88179
2023-09-21 14:15:59 -07:00
Elliott Hughes
bcaa454d32 bionic tests: use GTEST_SKIP.
Also be a bit more to the point in our messages, focusing on "why" not
"what".

Test: ran tests
Change-Id: I297806c7a102bd52602dcd2fcf7a2cd34aba3a11
2019-03-12 10:26:39 -07:00
Elliott Hughes
18181e6a0a Updates for glibc 2.17.
Bug: http://b/111358231
Test: builds
Change-Id: I542b2a9acc74261ad12b78e4add0f3ae77c3656c
2019-01-30 13:52:36 -08:00
Yabin Cui
78f5eb0498 Fix test getauxval.arm_has_AT_HWCAP2.
Bug: 27874785
Change-Id: Ibb39087c5353a0cca7783d39498b370e478fe91c
2016-03-29 15:41:49 -07:00
Elliott Hughes
900a4dc5a8 Don't bother insisting on AT_HWCAP2 for 32-bit devices.
Bug: http://b/27874785
Change-Id: I9dcf345ae1221f665f267cba3ed9279435671b75
2016-03-28 11:53:12 -07:00
Elliott Hughes
d4c9112490 Fix the AT_HWCAP2 test.
"I have none of these capabilities" is a legitimate response, and
distinct from "I don't know what my capabilities are". It's the latter
I meant to test for.

Bug: http://b/27810985
Change-Id: Id165423e62390051cbf23fdda54f28d94566cbe7
2016-03-25 08:29:05 -07:00
Elliott Hughes
ebb4895c68 Add a CTS test to ensure AT_HWCAP2 is reported.
This is important for performance of 32-bit ARM crypto code in apps.

Bug: http://b/27750752
Change-Id: If1cebc4d562aeb2ae0cc2834135af16e9bd0f79a
2016-03-21 11:13:16 -07:00
Daniel Micay
ee7649c5ac set errno to ENOENT in getauxval per glibc 2.19
Bionic's getauxval(...) implementation returns zero when entries are
missing. Zero can be a valid value, so there is no unambiguous way of
detecting an error. Since glibc 2.19, errno is set to ENOENT when an
entry is missing to make it possible to detect this. Bionic should match
this behavior as code in the Linux ecosystem will start relying on it to
check for the presence of newly added entries.

Change-Id: Ic1efe29bc45fc87489274c96c4d2193f3a7b8854
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
2015-03-17 19:50:55 -04:00
Elliott Hughes
f4c948a9e9 Move the meat of <features.h> into <sys/cdefs.h>.
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
2014-08-19 11:18:20 -07:00
Christopher Ferris
f04935c85e 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
2014-02-06 20:12:21 -08:00
Nick Kralevich
2c5153b043 libc: add getauxval()
Add support for getauxval().  This method allows a program an easy way
to retrieve information from the kernel auxiliary vector, and will
hopefully replace other clumsy ways of accessing this same information.

This particular function was also added to glibc in glibc 2.16.
See the following URLs for more details.

  * http://lwn.net/Articles/519085/
  * http://www.gnu.org/software/libc/manual/html_node/Auxiliary-Vector.html

This change is a prerequisite for bug 7959813.

Bug: http://code.google.com/p/android/issues/detail?id=38441
Change-Id: Iba19d899df334bddc6f4899077ece2fc87564ea8
2013-01-11 16:44:15 -08:00