summaryrefslogtreecommitdiff
path: root/tests/t-kdf.c
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2016-12-13 13:24:51 +0100
committerJustus Winter <justus@g10code.com>2016-12-13 13:52:19 +0100
commit4fae5c0b62f5a507a74db654c50ad1c8b182c6d5 (patch)
treeee1a255d0bbd4bc02b02677cc7982ec352cfce3d /tests/t-kdf.c
parent1b15ff58f9c17c16ce44acc110e2865e7d4d2321 (diff)
downloadlibgcrypt-4fae5c0b62f5a507a74db654c50ad1c8b182c6d5.tar.gz
tests: Use common code for all tests.
-- Also fix minor fallout from the format string warnings. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tests/t-kdf.c')
-rw-r--r--tests/t-kdf.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/tests/t-kdf.c b/tests/t-kdf.c
index 4299141b..91f30433 100644
--- a/tests/t-kdf.c
+++ b/tests/t-kdf.c
@@ -27,40 +27,9 @@
#include <stdarg.h>
#include <assert.h>
-#include "../src/gcrypt-int.h"
#include "stopwatch.h"
-
-
-#ifndef DIM
-# define DIM(v) (sizeof(v)/sizeof((v)[0]))
-#endif
-
-/* Program option flags. */
-static int verbose;
-static int debug;
-static int error_count;
-
-static void
-fail (const char *format, ...)
-{
- va_list arg_ptr;
-
- va_start (arg_ptr, format);
- vfprintf (stderr, format, arg_ptr);
- va_end (arg_ptr);
- error_count++;
-}
-
-static void
-die (const char *format, ...)
-{
- va_list arg_ptr;
-
- va_start (arg_ptr, format);
- vfprintf (stderr, format, arg_ptr);
- va_end (arg_ptr);
- exit (1);
-}
+#define PGM "t-kdf"
+#include "t-common.h"
static void
@@ -1296,10 +1265,10 @@ main (int argc, char **argv)
if (s2kcount)
{
if (argc != 1)
- die ("usage: t-kdf --s2k S2KCOUNT\n", stderr );
+ die ("usage: t-kdf --s2k S2KCOUNT\n");
s2kcount = strtoul (*argv, NULL, 10);
if (!s2kcount)
- die ("t-kdf: S2KCOUNT must be positive\n", stderr );
+ die ("t-kdf: S2KCOUNT must be positive\n");
}
if (!gcry_check_version (GCRYPT_VERSION))