pub fn fail<T>( device: &Device, callback: impl FnOnce() -> T, expected_msg_substring: Option<&'static str> ) -> T
Run some code in an error scope and assert that validation fails.