()
| 204 | |
| 205 | #[test] |
| 206 | fn test_get_rx_timestamp_drift() { |
| 207 | let now = Utc::now() - chrono::Duration::seconds(60); |
| 208 | let rx_info = gw::UplinkRxInfo { |
| 209 | gw_time: Some(now.try_into().unwrap()), |
| 210 | ..Default::default() |
| 211 | }; |
| 212 | |
| 213 | let res: DateTime<Utc> = get_rx_timestamp(&[rx_info]).into(); |
| 214 | assert_ne!(res, now); |
| 215 | |
| 216 | let now = Utc::now() + chrono::Duration::seconds(60); |
| 217 | let rx_info = gw::UplinkRxInfo { |
| 218 | gw_time: Some(now.try_into().unwrap()), |
| 219 | ..Default::default() |
| 220 | }; |
| 221 | |
| 222 | let res: DateTime<Utc> = get_rx_timestamp(&[rx_info]).into(); |
| 223 | assert_ne!(res, now); |
| 224 | } |
| 225 | |
| 226 | #[test] |
| 227 | fn test_get_rx_timestamp_chrono_no_drift() { |
nothing calls this directly
no test coverage detected