Disable bn_shift benchmarks on Windows

Windows doesn't know about SIGALRM
This commit is contained in:
Theo Buehler 2022-12-18 01:16:15 +01:00
parent 8c4425cd53
commit da826ecc77

45
patches/bn_shift.patch Normal file
View File

@ -0,0 +1,45 @@
--- tests/bn_shift.c.orig Sun Dec 18 01:05:29 2022
+++ tests/bn_shift.c Sun Dec 18 01:15:00 2022
@@ -26,6 +26,10 @@
#include <openssl/bn.h>
+#ifndef _MSC_VER
+#define INCLUDE_BENCHMARKS
+#endif
+
static const char *bn_shift_want_hex = \
"02AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8";
@@ -314,6 +318,8 @@ test_bn_rshift_to_zero(void)
return failed;
}
+#ifdef INCLUDE_BENCHMARKS
+
static void
benchmark_bn_lshift1(BIGNUM *bn)
{
@@ -507,9 +513,12 @@ benchmark_run(const struct benchmark *bm, int seconds)
BN_free(bn);
}
+#endif
+
static void
benchmark_bn_shift(void)
{
+#ifdef INCLUDE_BENCHMARKS
const struct benchmark *bm;
size_t i;
@@ -517,6 +526,9 @@ benchmark_bn_shift(void)
bm = &benchmarks[i];
benchmark_run(bm, 5);
}
+#else
+ return;
+#endif
}
int