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

Function add_ntp_source

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

Source from the content-addressed store, hash-verified

267
268 #[test]
269 fn add_ntp_source() {
270 let (_, link_local_rx) = create(1);
271
272 let (_, ntp_source_rx) = create(1);
273 let dummy_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 123);
274 let dummy_ntp_source_receiver: NTPSourceReceiver = (dummy_address, ntp_source_rx);
275
276 let mut rx_stream = ReceiverStream::builder().link_local(link_local_rx).build();
277
278 assert!(rx_stream.ntp_sources.is_empty());
279
280 rx_stream.add_ntp_source(dummy_ntp_source_receiver);
281
282 assert!(rx_stream.ntp_sources.len() == 1);
283 }
284
285 #[test]
286 fn remove_ntp_source() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected