| Crates.io | segv-test |
| lib.rs | segv-test |
| version | 0.1.0 |
| created_at | 2025-07-31 15:14:06.130469+00 |
| updated_at | 2025-07-31 15:14:06.130469+00 |
| description | Macro to test that a segmentation fault occurs |
| homepage | https://github.com/jprendes/segv-test |
| repository | https://github.com/jprendes/segv-test |
| max_upload_size | |
| id | 1775204 |
| size | 10,968 |
A small library providing an assert_segv! macro to test that some code triggers a segmentation fault.
use segv_test::assert_segv;
const INVALID_PTR: *mut i32 = 0x08 as *mut i32;
#[test]
fn test_a_segv() {
assert_segv!(unsafe {
INVALID_PTR.write_volatile(1);
});
}