]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: added check to verify that including crypto.h is sufficient
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 26 Feb 2017 18:16:32 +0000 (19:16 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 6 Mar 2017 21:24:33 +0000 (22:24 +0100)
That is, sufficient to use its functionality, and including additional
headers isn't necessary.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
tests/slow/Makefile.am
tests/slow/crypto.c [new file with mode: 0644]

index 65c8a4297af2c37bf88720bb7f7080f7df1cf120..7c9fc543cfa03ef9bfc680157ea117b52647bcaf 100644 (file)
@@ -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 (file)
index 0000000..eedaf3f
--- /dev/null
@@ -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;
+}