From: Nikos Mavrogiannopoulos Date: Sun, 26 Feb 2017 18:16:32 +0000 (+0100) Subject: tests: added check to verify that including crypto.h is sufficient X-Git-Tag: gnutls_3_6_0~887 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04db12cc378e3973ac6da8095e622acbb0dbea82;p=thirdparty%2Fgnutls.git tests: added check to verify that including crypto.h is sufficient That is, sufficient to use its functionality, and including additional headers isn't necessary. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/tests/slow/Makefile.am b/tests/slow/Makefile.am index 65c8a4297a..7c9fc543cf 100644 --- a/tests/slow/Makefile.am +++ b/tests/slow/Makefile.am @@ -53,8 +53,8 @@ endif dist_check_SCRIPTS = test-ciphers.sh override-ciphers test-hash-large test-ciphers-common.sh -check_PROGRAMS = $(ctests) cipher-test cipher-override mac-override cipher-override2 hash-large -TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large +check_PROGRAMS = $(ctests) cipher-test cipher-override mac-override cipher-override2 hash-large crypto +TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large crypto if HAVE_LIBCRYPTO cipher_openssl_compat_LDFLAGS = $(LDADD) $(LIBCRYPTO) diff --git a/tests/slow/crypto.c b/tests/slow/crypto.c new file mode 100644 index 0000000000..eedaf3fb0c --- /dev/null +++ b/tests/slow/crypto.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include +#include +#include +#include + +/* this tests whether including crypto.h is sufficient to use + * its functionality */ + +int main(int argc, char **argv) +{ + char output[64]; + assert(gnutls_hash_fast(GNUTLS_DIG_SHA256, "abc", 3, output) >= 0); + return 0; +}