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

Function test_decode_buffer_ieee754

chirpstack/src/codec/js/mod.rs:221–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219
220 #[tokio::test]
221 pub async fn test_decode_buffer_ieee754() {
222 let recv_time = Utc.with_ymd_and_hms(2014, 7, 8, 9, 10, 11).unwrap();
223
224 let decoder = r#"
225 function decodeUplink(input) {
226 var buf = new Buffer(input.bytes);
227
228 return {
229 data: {
230 temp: buf.readFloatBE(0).toFixed(3),
231 }
232 };
233 }
234 "#
235 .to_string();
236
237 let vars: HashMap<String, String> = HashMap::new();
238
239 // This tests that the buffer module correctly resolves the ieee754 module.
240 let _ = decode(recv_time, 10, &vars, &decoder, &[0x00, 0x00, 0x00, 0x00])
241 .await
242 .unwrap();
243 }
244
245 #[tokio::test]
246 pub async fn test_decode() {

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.80
to_stringMethod · 0.80
decodeFunction · 0.70

Tested by

no test coverage detected