()
| 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 | } |
nothing calls this directly
no test coverage detected