summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-02-26 19:16:32 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-03-06 22:24:33 +0100
commit04db12cc378e3973ac6da8095e622acbb0dbea82 (patch)
tree3d7201e10a2db440871684167706ec1f745ea1a7
parentb726cd1f5e273caf9b19a19dbba62a2e89ee8edf (diff)
downloadgnutls-04db12cc378e3973ac6da8095e622acbb0dbea82.tar.gz
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 <nmav@gnutls.org>
-rw-r--r--tests/slow/Makefile.am4
-rw-r--r--tests/slow/crypto.c17
2 files changed, 19 insertions, 2 deletions
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 <config.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <gnutls/crypto.h>
+
+/* 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;
+}