diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-05 22:44:07 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-05 22:44:07 +0000 |
commit | 7fb13df4f337ed260dd3521532e06274456fdffa (patch) | |
tree | 99d8c1d50a0a5b2043f8f5f8fb89d8f18605ef78 | |
parent | 6ee9037674e4e932fd0eee3acaa4d47e78fdc6fa (diff) | |
download | FreeBSD-src-7fb13df4f337ed260dd3521532e06274456fdffa.zip FreeBSD-src-7fb13df4f337ed260dd3521532e06274456fdffa.tar.gz |
MFC r290908,r291615:
r290908:
Integrate contrib/netbsd-tests/lib/libcrypt/t_crypt.c in to the FreeBSD
test suite as lib/libcrypt/crypt_test
Sponsored by: EMC / Isilon Storage Division
r291615 (by rodrigc):
Hack test so that it works on FreeBSD.
-rw-r--r-- | contrib/netbsd-tests/lib/libcrypt/t_crypt.c | 6 | ||||
-rw-r--r-- | lib/libcrypt/tests/Makefile | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/contrib/netbsd-tests/lib/libcrypt/t_crypt.c b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c index a5a4dcb..9b47692 100644 --- a/contrib/netbsd-tests/lib/libcrypt/t_crypt.c +++ b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c @@ -124,11 +124,13 @@ ATF_TC_HEAD(crypt_salts, tc) ATF_TC_BODY(crypt_salts, tc) { for (size_t i = 0; tests[i].hash; i++) { + char *hash = crypt(tests[i].pw, tests[i].hash); #if defined(__FreeBSD__) - if (22 <= i) + if (i >= 22 && i != 24 && i != 25) atf_tc_expect_fail("Old-style/bad inputs fail on FreeBSD"); + else + atf_tc_expect_pass(); #endif - char *hash = crypt(tests[i].pw, tests[i].hash); if (!hash) { ATF_CHECK_MSG(0, "Test %zu NULL\n", i); continue; diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile index 20993e2..65ebd66 100644 --- a/lib/libcrypt/tests/Makefile +++ b/lib/libcrypt/tests/Makefile @@ -1,13 +1,17 @@ # $FreeBSD$ -# exercise libcrypt +SRCTOP= ${.CURDIR:H:H:H} +OBJTOP= ${.OBJDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libcrypt TESTSDIR= ${TESTSBASE}/lib/libcrypt -ATF_TESTS_C= crypt_tests +NETBSD_ATF_TESTS_C+= crypt_test CFLAGS+= -I${.CURDIR:H} DPADD+= ${LIBCRYPT} LDADD+= -lcrypt +.include <netbsd-tests.test.mk> + .include <bsd.test.mk> |