Skip to content

Commit 12d96d3

Browse files
committed
update "should terminate abnormally" test to trigger a different ARG_CHECK
We can no longer produce non-verification context objects, so instead produce an invalid public key.
1 parent 3d38089 commit 12d96d3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,9 @@ mod tests {
584584
#[test]
585585
#[ignore] // Panicking from C may trap (SIGILL) intentionally, so we test this manually.
586586
fn test_panic_raw_ctx_should_terminate_abnormally() {
587-
let ctx_vrfy = Secp256k1::verification_only();
588-
let raw_ctx_verify_as_full = unsafe {Secp256k1::from_raw_all(ctx_vrfy.ctx)};
589-
// Generating a key pair in verify context will panic (ARG_CHECK).
590-
raw_ctx_verify_as_full.generate_keypair(&mut thread_rng());
587+
// Trying to use an all-zeros public key should cause an ARG_CHECK to trigger.
588+
let pk = PublicKey::from(unsafe { ffi::PublicKey::new() });
589+
pk.serialize();
591590
}
592591

593592
#[test]

0 commit comments

Comments
 (0)