MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_get_max_f_cnt_down

Function test_get_max_f_cnt_down

chirpstack/src/storage/device_queue.rs:318–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316
317 #[tokio::test]
318 async fn test_get_max_f_cnt_down() {
319 let _guard = test::prepare().await;
320 let dp = storage::device_profile::test::create_device_profile(None).await;
321 let d = storage::device::test::create_device(
322 EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
323 dp.id.into(),
324 None,
325 )
326 .await;
327
328 // create
329 let mut qi = DeviceQueueItem {
330 dev_eui: d.dev_eui,
331 f_port: 10,
332 data: vec![0x01, 0x02, 0x03],
333 ..Default::default()
334 };
335 qi = enqueue_item(qi).await.unwrap();
336
337 // No max_f_cnt.
338 let max_f_cnt = get_max_f_cnt_down(d.dev_eui).await.unwrap();
339 assert_eq!(None, max_f_cnt);
340
341 qi.f_cnt_down = Some(10);
342 update_item(qi).await.unwrap();
343 let max_f_cnt = get_max_f_cnt_down(d.dev_eui).await.unwrap();
344 assert_eq!(Some(10), max_f_cnt);
345 }
346}

Callers

nothing calls this directly

Calls 8

prepareFunction · 0.85
create_device_profileFunction · 0.85
create_deviceFunction · 0.85
enqueue_itemFunction · 0.85
get_max_f_cnt_downFunction · 0.85
update_itemFunction · 0.85
unwrapMethod · 0.80
intoMethod · 0.45

Tested by

no test coverage detected