diff --git a/update-engine/src/buffer.rs b/update-engine/src/buffer.rs index f3395e4667..1779ef7da6 100644 --- a/update-engine/src/buffer.rs +++ b/update-engine/src/buffer.rs @@ -1391,6 +1391,7 @@ mod tests { "all events passed in", |buffer, event| { buffer.add_event(event.clone()); + true }, WithDeltas::No, ) @@ -1402,8 +1403,9 @@ mod tests { |buffer, event| match event { Event::Step(event) => { buffer.add_step_event(event.clone()); + true } - Event::Progress(_) => {} + Event::Progress(_) => false, }, WithDeltas::Both, ) @@ -1416,11 +1418,13 @@ mod tests { Event::Step(event) => match event.kind.priority() { StepEventPriority::High => { buffer.add_step_event(event.clone()); + true } - StepEventPriority::Low => {} + StepEventPriority::Low => false, }, Event::Progress(event) => { buffer.add_progress_event(event.clone()); + true } }, WithDeltas::Both, @@ -1434,11 +1438,13 @@ mod tests { Event::Step(event) => match event.kind.priority() { StepEventPriority::High => { buffer.add_step_event(event.clone()); + true } - StepEventPriority::Low => {} + StepEventPriority::Low => false, }, Event::Progress(_) => { // Don't add progress events. + false } }, WithDeltas::Both, @@ -1570,7 +1576,10 @@ mod tests { fn run_filtered_test( &self, event_fn_description: &str, - mut event_fn: impl FnMut(&mut EventBuffer, &Event), + mut event_fn: impl FnMut( + &mut EventBuffer, + &Event, + ) -> bool, with_deltas: WithDeltas, ) -> anyhow::Result<()> { match with_deltas { @@ -1595,7 +1604,10 @@ mod tests { fn run_filtered_test_inner( &self, - mut event_fn: impl FnMut(&mut EventBuffer, &Event), + mut event_fn: impl FnMut( + &mut EventBuffer, + &Event, + ) -> bool, with_deltas: bool, ) -> anyhow::Result<()> { let description = format!("with deltas = {with_deltas}"); @@ -1613,7 +1625,8 @@ mod tests { let mut last_seen_opt = with_deltas.then_some(None); for (i, event) in self.generated_events.iter().enumerate() { - (event_fn)(&mut buffer, event); + // Going to use event_added in an upcoming commit. + let _event_added = (event_fn)(&mut buffer, event); let report = match last_seen_opt { Some(last_seen) => buffer.generate_report_since(last_seen),