From 60f7f2de5de917c2bee32a4cd79cc3818b6a94a0 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Tue, 30 Jul 2019 14:42:17 +0200 Subject: [PATCH] Don't assume that ALIGNMENT > 1 in tests --- src/tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests.c b/src/tests.c index 94deb4c1dea20..0f46cf54a5f26 100644 --- a/src/tests.c +++ b/src/tests.c @@ -366,8 +366,8 @@ void run_scratch_tests(void) { CHECK(scratch->alloc_size != 0); CHECK(scratch->alloc_size % ALIGNMENT == 0); - /* Allocating another 500 bytes fails */ - CHECK(secp256k1_scratch_alloc(&none->error_callback, scratch, 500) == NULL); + /* Allocating another 501 bytes fails */ + CHECK(secp256k1_scratch_alloc(&none->error_callback, scratch, 501) == NULL); CHECK(secp256k1_scratch_max_allocation(&none->error_callback, scratch, 0) == 1000 - adj_alloc); CHECK(secp256k1_scratch_max_allocation(&none->error_callback, scratch, 1) == 1000 - adj_alloc - (ALIGNMENT - 1)); CHECK(scratch->alloc_size != 0);