Skip encryption tests if override of calls within libzip doesn’t work.
diff --git a/regress/encryption-nonrandom-aes128.test b/regress/encryption-nonrandom-aes128.test
index fa21efe..cafb3af 100644
--- a/regress/encryption-nonrandom-aes128.test
+++ b/regress/encryption-nonrandom-aes128.test
@@ -1,4 +1,5 @@
features CRYPTO
+precheck liboverride-test
description encrypt file without entropy, to make results repeatable
return 0
preload nonrandomopen.so
diff --git a/regress/encryption-nonrandom-aes192.test b/regress/encryption-nonrandom-aes192.test
index bd0ebc4..7a3b2c2 100644
--- a/regress/encryption-nonrandom-aes192.test
+++ b/regress/encryption-nonrandom-aes192.test
@@ -1,4 +1,5 @@
features CRYPTO
+precheck liboverride-test
description encrypt file without entropy, to make results repeatable
return 0
preload nonrandomopen.so
diff --git a/regress/encryption-nonrandom-aes256.test b/regress/encryption-nonrandom-aes256.test
index ee6be9f..7049b35 100644
--- a/regress/encryption-nonrandom-aes256.test
+++ b/regress/encryption-nonrandom-aes256.test
@@ -1,4 +1,5 @@
features CRYPTO
+precheck liboverride-test
description encrypt file without entropy, to make results repeatable
return 0
preload nonrandomopen.so
diff --git a/regress/encryption-nonrandom-pkware.test b/regress/encryption-nonrandom-pkware.test
index a01b168..a2c73d5 100644
--- a/regress/encryption-nonrandom-pkware.test
+++ b/regress/encryption-nonrandom-pkware.test
@@ -1,4 +1,5 @@
features CRYPTO
+precheck liboverride-test
description encrypt file by Traditional PKWARE
return 0
preload nonrandomopen.so
diff --git a/regress/liboverride-test.c b/regress/liboverride-test.c
index c274f61..5190586 100644
--- a/regress/liboverride-test.c
+++ b/regress/liboverride-test.c
@@ -37,12 +37,6 @@
#include "zip.h"
-#define DEBUG 1
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
/*
Some systems bind functions called and defined within a shared library, so the override doesn't work. This program calls zip_open and checks whether the override worked.
*/
@@ -54,30 +48,18 @@
if (getenv("LIBOVERRIDE_SET") == NULL) {
setenv("LIBOVERRIDE_SET", "1", 1);
setenv("LD_PRELOAD", "libliboverride.so", 1);
-#ifdef DEBUG
- printf("setting LD_PRELOAD and calling us again\n");
-#endif
execv(argv[0], (void *)argv);
exit(2);
}
if (zip_open("nosuchfile", 0, &error_code) != NULL) {
-#ifdef DEBUG
- printf("zip_open() succeeded\n");
-#endif
/* We expect failure. */
exit(1);
}
if (error_code != 32000) {
-#ifdef DEBUG
- printf("got wrong error code %d\n", error_code);
-#endif
/* Override didn't take, we didn't get its magic error code. */
exit(1);
}
-#ifdef DEBUG
- printf("override worked\n");
-#endif
exit(0);
}