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

Function test_zstd_decode

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

Source from the content-addressed store, hash-verified

74
75 #[test]
76 fn test_zstd_decode() {
77 let d = ZstdDecoder::default();
78 let valid_input = vec![40, 181, 47, 253, 32, 2, 17, 0, 0, 1, 254];
79 let mut output1 = vec![0; 2];
80 d.decode(&valid_input, &mut output1).unwrap();
81 assert_eq!(&output1, b"\x01\xfe");
82
83 let invalid_input = vec![1, 2, 3, 4];
84 let mut output2 = vec![0; 1024];
85 d.decode(&invalid_input, &mut output2).unwrap_err();
86 }
87}

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected