From 040e480dd038be13d64d6978c1879d6106263eab Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 7 Sep 2024 17:12:34 -0400 Subject: [PATCH] fix events::adding_and_removing_listeners test failure in release mode best guess is that release mode optimizations collapsed these two functions into one, because in release mode the assertion that would fail was: assert!(listeners.add(other_dummy_listener)); which would mean that `listeners.add()` thought it was trying to add a duplicate listener function. adding dummy println's is a simple way to ensure that the compiler won't try to collapse these thinking that they are the same function. --- ggdt/src/events/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ggdt/src/events/mod.rs b/ggdt/src/events/mod.rs index dbbf6b8..cd3bdca 100644 --- a/ggdt/src/events/mod.rs +++ b/ggdt/src/events/mod.rs @@ -175,10 +175,12 @@ mod tests { } fn dummy_listener(_event: &TestEvent, _context: &mut DummyContext) -> bool { + println!("dummy_listener event fired"); false } fn other_dummy_listener(_event: &TestEvent, _context: &mut DummyContext) -> bool { + println!("other_dummy_listener event fired"); false }