summaryrefslogtreecommitdiffstats
path: root/g10/t-stutter.c
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-03-22 12:40:42 +0100
committerJustus Winter <justus@g10code.com>2017-04-24 14:14:05 +0200
commited4d23d75e8ba89e998b88a4f862661c81f665a3 (patch)
tree7e956da634802ab2d802f5e5d9e208932d606926 /g10/t-stutter.c
parentgpgscm: Move 'trace' and 'stringify'. (diff)
downloadgnupg2-ed4d23d75e8ba89e998b88a4f862661c81f665a3.tar.xz
gnupg2-ed4d23d75e8ba89e998b88a4f862661c81f665a3.zip
tests: Locate resources and scripts relative to top source dir.
-- Locate every resource and every script used in the tests using a path relative to the top of the source tree. This is a purely mechanical change, mostly done using regular expressions, with a few manual fixups here and there. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'g10/t-stutter.c')
-rw-r--r--g10/t-stutter.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/g10/t-stutter.c b/g10/t-stutter.c
index f4a9a5988..8fe242d53 100644
--- a/g10/t-stutter.c
+++ b/g10/t-stutter.c
@@ -58,6 +58,8 @@
#include "dek.h"
#include "../common/logging.h"
+#include "test.c"
+
static void
log_hexdump (byte *buffer, int length)
{
@@ -368,8 +370,8 @@ oracle_test (unsigned int d, int b, int debug)
return oracle (debug, probe, blocksize + 2, NULL, NULL) == 0;
}
-int
-main (int argc, char *argv[])
+static void
+do_test (int argc, char *argv[])
{
int i;
int debug = 0;
@@ -379,8 +381,6 @@ main (int argc, char *argv[])
byte *raw_data;
int raw_data_len;
- int failed = 0;
-
for (i = 1; i < argc; i ++)
{
if (strcmp (argv[i], "--debug") == 0)
@@ -396,11 +396,10 @@ main (int argc, char *argv[])
}
}
- if (! blocksize && ! filename && (filename = getenv ("srcdir")))
+ if (! blocksize && ! filename && (filename = prepend_srcdir ("t-stutter-data.asc")))
/* Try defaults. */
{
parse_session_key ("9:9274A8EC128E850C6DDDF9EAC68BFA84FC7BC05F340DA41D78C93D0640C7C503");
- filename = xasprintf ("%s/t-stutter-data.asc", filename);
}
if (help || ! blocksize || ! filename)
@@ -601,7 +600,7 @@ main (int argc, char *argv[])
isprint (pt[0]) ? pt[0] : '?',
isprint (pt[1]) ? pt[1] : '?',
hexstr (m));
- failed = 1;
+ tests_failed++;
}
}
@@ -610,5 +609,4 @@ main (int argc, char *argv[])
}
xfree (filename);
- return failed;
}