We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8287727 commit f6c2423Copy full SHA for f6c2423
lightning/src/util/test_utils.rs
@@ -270,6 +270,7 @@ impl TestChannelMessageHandler {
270
fn received_msg(&self, ev: wire::Message<()>) {
271
let mut msgs = self.expected_recv_msgs.lock().unwrap();
272
if msgs.is_none() { return; }
273
+ assert!(!msgs.as_ref().unwrap().is_empty(), "Received message when we weren't expecting one");
274
#[cfg(test)]
275
assert_eq!(msgs.as_ref().unwrap()[0], ev);
276
msgs.as_mut().unwrap().remove(0);
@@ -279,7 +280,9 @@ impl TestChannelMessageHandler {
279
280
impl Drop for TestChannelMessageHandler {
281
fn drop(&mut self) {
282
let l = self.expected_recv_msgs.lock().unwrap();
- assert!(l.is_none() || l.as_ref().unwrap().is_empty());
283
+ if !std::thread::panicking() {
284
+ assert!(l.is_none() || l.as_ref().unwrap().is_empty());
285
+ }
286
}
287
288
0 commit comments