Skip to content

Commit 8c24790

Browse files
fixup! Add tests for contexts in preallocated memory
1 parent bf35e5d commit 8c24790

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tests.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ void run_context_tests(int use_preallocated) {
188188
secp256k1_context_set_error_callback(sign, counting_illegal_callback_fn, NULL);
189189
CHECK(vrfy->error_callback.fn != sign->error_callback.fn);
190190

191+
/* check if sizes for cloning are consistent */
192+
CHECK(secp256k1_context_preallocated_clone_size(none) == secp256k1_context_preallocated_size(SECP256K1_CONTEXT_NONE));
193+
CHECK(secp256k1_context_preallocated_clone_size(sign) == secp256k1_context_preallocated_size(SECP256K1_CONTEXT_SIGN));
194+
CHECK(secp256k1_context_preallocated_clone_size(vrfy) == secp256k1_context_preallocated_size(SECP256K1_CONTEXT_VERIFY));
195+
CHECK(secp256k1_context_preallocated_clone_size(both) == secp256k1_context_preallocated_size(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY));
196+
191197
/*** clone and destroy all of them to make sure cloning was complete ***/
192198
{
193199
secp256k1_context *ctx_tmp;

0 commit comments

Comments
 (0)