MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / test_zlib_decode

Function test_zlib_decode

block/src/qcow/decoder.rs:63–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62 #[test]
63 fn test_zlib_decode() {
64 let d = ZlibDecoder::default();
65 let valid_input = vec![99, 96, 100, 98, 6, 0];
66 let mut output1 = vec![0; 4];
67 d.decode(&valid_input, &mut output1).unwrap();
68 assert_eq!(&output1, b"\x00\x01\x02\x03");
69
70 let invalid_input = vec![1, 2, 3, 4];
71 let mut output2 = vec![0; 1024];
72 d.decode(&invalid_input, &mut output2).unwrap_err();
73 }
74
75 #[test]
76 fn test_zstd_decode() {

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected