From 04db12cc378e3973ac6da8095e622acbb0dbea82 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 26 Feb 2017 19:16:32 +0100 Subject: 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 --- tests/slow/Makefile.am | 4 ++-- tests/slow/crypto.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tests/slow/crypto.c 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; +} -- cgit v1.2.1