Skip to content

Commit efbf256

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 63abd2a commit efbf256

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
@@ -634,10 +634,9 @@ mod tests {
634634
#[ignore] // Panicking from C may trap (SIGILL) intentionally, so we test this manually.
635635
#[cfg(any(feature = "alloc", feature = "std"))]
636636
fn test_panic_raw_ctx_should_terminate_abnormally() {
637-
let ctx_vrfy = Secp256k1::verification_only();
638-
let raw_ctx_verify_as_full = unsafe {Secp256k1::from_raw_all(ctx_vrfy.ctx)};
639-
// Generating a key pair in verify context will panic (ARG_CHECK).
640-
raw_ctx_verify_as_full.generate_keypair(&mut thread_rng());
637+
// Trying to use an all-zeros public key should cause an ARG_CHECK to trigger.
638+
let pk = PublicKey::from(unsafe { ffi::PublicKey::new() });
639+
pk.serialize();
641640
}
642641

643642
#[test]

0 commit comments

Comments
 (0)