libffi-rs
libffi-rs copied to clipboard
Add tests for ClosureOnce.
We check that we can call a ClosureOnce once successfully, but calling it a second time is an error. Normally if this error occurs, the program exits (code 2), because it isn’t safe to panic when calling an FFI callback. However, in cfg(test) this error instead causes a panic, so that we can test the error using #[should_panic].