MCPcopy Create free account
hub / github.com/aws/clock-bound / remove_ntp_source

Function remove_ntp_source

clock-bound/src/daemon/receiver_stream.rs:286–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285 #[test]
286 fn remove_ntp_source() {
287 let (_, link_local_rx) = create(1);
288 let (_, ntp_source_rx) = create(1);
289
290 let dummy_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 123);
291 let dummy_ntp_source_receiver: NTPSourceReceiver = (dummy_address, ntp_source_rx);
292
293 let mut rx_stream = ReceiverStream::builder()
294 .link_local(link_local_rx)
295 .ntp_sources(HashMap::from([dummy_ntp_source_receiver]))
296 .build();
297
298 assert!(rx_stream.ntp_sources.len() == 1);
299
300 rx_stream.remove_ntp_source(&dummy_address);
301
302 assert!(rx_stream.ntp_sources.is_empty());
303 }
304}

Callers

nothing calls this directly

Calls 4

createFunction · 0.85
remove_ntp_sourceMethod · 0.80
newFunction · 0.50
buildMethod · 0.45

Tested by

no test coverage detected