From 3a411b5d8a6c6311778e22280706047cd1a8c8d4 Mon Sep 17 00:00:00 2001 From: Salvatore Cro Date: Fri, 8 Apr 2011 17:56:22 +0200 Subject: test: fix tst-tls13 expected result and timeout tst-tls13 is expected to return 0 when passing. Set higher timeout to avoid failure on slow archs. Signed-off-by: Salvatore Cro Signed-off-by: Carmelo Amoroso --- test/tls/Makefile.in | 1 - test/tls/tst-tls13.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'test') 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" -- cgit v1.2.3 From 23135f442dc220b496e2a4af3366cc2795587ec7 Mon Sep 17 00:00:00 2001 From: David A Ramos Date: Sun, 1 May 2011 17:28:31 +0200 Subject: inet: add ether_aton testcase Signed-off-by: Bernhard Reutner-Fischer --- test/inet/tst-ether_aton.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/inet/tst-ether_aton.c (limited to 'test') 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 +#include +#include +#include + +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; +} -- cgit v1.2.3 From 63e3a411b1e4ae6c8c9132405f80f6c6bdf90183 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 1 May 2011 18:00:04 +0200 Subject: tests: disable ether tests if !HAS_SOCKET Signed-off-by: Bernhard Reutner-Fischer --- test/inet/Makefile.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.3 From eba2360222e8e8b9218942e25ef12664bc153f2e Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Mon, 2 May 2011 12:59:18 +0200 Subject: test_nptl: fix expected result for tst-clock2 test tst-clock2 should return 0 when _SC_THREAD_CPUTIME option isn't available, instead of treating it as an error. Further set the expected ret value as 0 avoiding to hide any real failures in case of THREAD_CPUTIME feature available. Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- test/nptl/Makefile.in | 1 - test/nptl/tst-clock2.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'test') diff --git a/test/nptl/Makefile.in b/test/nptl/Makefile.in index b6a279ebf..667156945 100644 --- a/test/nptl/Makefile.in +++ b/test/nptl/Makefile.in @@ -221,7 +221,6 @@ 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 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 -- cgit v1.2.3 From 074c5fcc9800847947d1819cb44cac962a19b1a5 Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Tue, 3 May 2011 09:32:53 +0200 Subject: test_nptl: fix expected result for tst-cputimer[123] Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- test/nptl/Makefile.in | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test') diff --git a/test/nptl/Makefile.in b/test/nptl/Makefile.in index 667156945..b91480250 100644 --- a/test/nptl/Makefile.in +++ b/test/nptl/Makefile.in @@ -221,8 +221,4 @@ OPTS_tst-cancel7 = --command ./tst-cancel7 OPTS_tst-mqueue7 = -- ./tst-mqueue7 OPTS_tst-exec4 = ./tst-exec4 -RET_tst-cputimer1 := 1 -RET_tst-cputimer2 := 1 -RET_tst-cputimer3 := 1 - WRAPPER := env LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)" TIMEOUTFACTOR=100 -- cgit v1.2.3