libffi-rs icon indicating copy to clipboard operation
libffi-rs copied to clipboard

Add tests for ClosureOnce.

Open tov opened this issue 4 years ago • 0 comments

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].

tov avatar Dec 20 '21 18:12 tov