Commit graph

7 commits

Author SHA1 Message Date
Colin Cross
4c5595c968 Replace local MUSL define with global ANDROID_HOST_MUSL
Bug: 190084016
Test: m USE_HOST_MUSL=true bionic-unit-tests-glibc
Change-Id: I56b23576cb24912112d2ae56d8ecc2e3716982fe
2021-08-16 16:44:24 -07:00
Colin Cross
7da20341e9 Build bionic unit tests for musl
Modify bionic unit tests that are built for glibc so that they also
build against musl.  They don't all pass though:

With glibc:
 2 SLOW TESTS
 4 TIMEOUT TESTS
313 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

With musl:
11 SLOW TESTS
11 TIMEOUT TESTS
363 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

Bug: 190084016
Test: m bionic-unit-tests-glibc with musl
Test: atest bionic-unit-tests-static
Test: atest --host bionic-unit-tests-glibc with glibc
Change-Id: I79b6eab04fed3cc4392450df5eef2579412edfe1
2021-08-12 11:13:11 -07:00
Elliott Hughes
c30a1c08ec Add tests for inet_nsap_addr()/inet_nsap_ntoa().
Turns out that "NSAP" is yet another ISO standard that no-one actually
uses: https://en.wikipedia.org/wiki/NSAP_address

Test: treehugger
Change-Id: I73b4d924a8f4d34e3e2f2da00d0d5529db8e97d1
2021-04-09 16:26:40 -07:00
Elliott Hughes
7b77cb35af Fix inet_aton on LP32.
I wasn't checking for overflow. Luckily, I had a test that overflows on LP32.

Change-Id: If2cf33d88f459eb26d0ce75f3c5ed192f516ab7a
2015-10-09 17:36:05 -07:00
Elliott Hughes
047866672c Fix inet_addr/inet_aton/inet_network.
Rewrite inet_addr and inet_network in terms of inet_aton, and reimplement
that to include all the missing error checks.

Bug: http://b/24754503
Change-Id: I5dfa971c87201968985a0894df419f0fbf54768a
2015-10-09 15:44:24 -07:00
Elliott Hughes
5c8c88dd8d Use the NetBSD inet_ntop until the OpenBSD bug is fixed.
Stupidly I found this bug by accident when writing the existing
tests, but I didn't think any real code would hit it. It turns
out that libcore always uses an INET6_ADDRSTRLEN-sized buffer
even when working with AF_INET addresses.

Change-Id: Ieffc8e4bbe9b66b49b033e3e7101c896e097e6f8
2014-05-13 19:17:46 -07:00
Elliott Hughes
6a41b0fb0e Flesh out <arpa/inet.h>.
Use the upstream OpenBSD implementations of these functions.

Also ensure we have symbols for htonl, htons, ntohl, and ntohs.
gtest doesn't like us using the macro versions in ASSERT_EQ.

Bug: 14840760
Change-Id: I68720e9aca14838df457d2bb27b999d5818ac2b5
2014-05-13 18:08:29 -07:00