diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/inet/Makefile.in | 6 | ||||
-rw-r--r-- | test/inet/tst-ether_aton.c | 46 | ||||
-rw-r--r-- | test/nptl/Makefile.in | 5 | ||||
-rw-r--r-- | test/nptl/tst-clock2.c | 2 | ||||
-rw-r--r-- | test/tls/Makefile.in | 1 | ||||
-rw-r--r-- | test/tls/tst-tls13.c | 2 |
6 files changed, 53 insertions, 9 deletions
diff --git a/test/inet/Makefile.in b/test/inet/Makefile.in index 0c0b9dc3d..0710d3d71 100644 --- a/test/inet/Makefile.in +++ b/test/inet/Makefile.in @@ -3,5 +3,9 @@ # ifeq ($(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6),) TESTS_DISABLED := bug-if1 gethost_r-align gethostid if_nameindex tst-aton \ - tst-network tst-ntoa + tst-network tst-ntoa +endif + +ifeq ($(UCLIBC_HAS_SOCKET)$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6),) +TESTS_DISABLED := tst-ether_aton tst-ethers tst-ethers-line endif diff --git a/test/inet/tst-ether_aton.c b/test/inet/tst-ether_aton.c new file mode 100644 index 000000000..67cb43540 --- /dev/null +++ b/test/inet/tst-ether_aton.c @@ -0,0 +1,46 @@ +#include <stdio.h> +#include <stdint.h> +#include <string.h> +#include <netinet/ether.h> + +static struct tests +{ + const char *input; + int valid; + uint8_t result[6]; +} tests[] = +{ + { "", 0, {0, 0, 0, 0, 0, 0} }, + { "AB:CD:EF:01:23:45", 1, {171, 205, 239, 1, 35, 69} }, + { "\022B:BB:BB:BB:BB:BB", 0, {0, 0, 0, 0, 0, 0} } +}; + + +int +main (int argc, char *argv[]) +{ + int result = 0; + size_t cnt; + + for (cnt = 0; cnt < sizeof (tests) / sizeof (tests[0]); ++cnt) + { + struct ether_addr *addr; + + if (!!(addr = ether_aton (tests[cnt].input)) != tests[cnt].valid) + { + if (tests[cnt].valid) + printf ("\"%s\" not seen as valid MAC address\n", tests[cnt].input); + else + printf ("\"%s\" seen as valid MAC address\n", tests[cnt].input); + result = 1; + } + else if (tests[cnt].valid + && memcmp(addr, &tests[cnt].result, sizeof(struct ether_addr))) + { + printf ("\"%s\" not converted correctly\n", tests[cnt].input); + result = 1; + } + } + + return result; +} diff --git a/test/nptl/Makefile.in b/test/nptl/Makefile.in index b6a279ebf..b91480250 100644 --- a/test/nptl/Makefile.in +++ b/test/nptl/Makefile.in @@ -221,9 +221,4 @@ OPTS_tst-cancel7 = --command ./tst-cancel7 OPTS_tst-mqueue7 = -- ./tst-mqueue7 OPTS_tst-exec4 = ./tst-exec4 -RET_tst-clock2 := 1 -RET_tst-cputimer1 := 1 -RET_tst-cputimer2 := 1 -RET_tst-cputimer3 := 1 - WRAPPER := env LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)" TIMEOUTFACTOR=100 diff --git a/test/nptl/tst-clock2.c b/test/nptl/tst-clock2.c index 49a769bf4..bca40956e 100644 --- a/test/nptl/tst-clock2.c +++ b/test/nptl/tst-clock2.c @@ -62,7 +62,7 @@ do_test (void) if (sysconf (_SC_THREAD_CPUTIME) < 0) { puts ("_POSIX_THREAD_CPUTIME option not available"); - return 1; + return 0; } # endif diff --git a/test/tls/Makefile.in b/test/tls/Makefile.in index d19d347f3..875c60779 100644 --- a/test/tls/Makefile.in +++ b/test/tls/Makefile.in @@ -140,7 +140,6 @@ tst-tlsmod18a%.so: tst-tlsmod18a.c $(LDFLAGS_tst-tlsmod18a.so) tst-tls-at-ctor: tst-tlsmod-at-ctor.so -RET_tst-tls13 := 1 ifeq ($(TARGET_ARCH),mips) RET_tst-tls15 := 1 endif diff --git a/test/tls/tst-tls13.c b/test/tls/tst-tls13.c index 55fb62e54..beee91bf4 100644 --- a/test/tls/tst-tls13.c +++ b/test/tls/tst-tls13.c @@ -26,5 +26,5 @@ do_test (void) } #define TEST_FUNCTION do_test () -#define TIMEOUT 3 +#define TIMEOUT 20 #include "../test-skeleton.c" |