diff options
| author | Yuval Adam <_@yuv.al> | 2019-03-19 22:38:32 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2019-03-19 22:38:32 +0200 |
| commit | c2a1254dccd9356c6aab4946a41759f492885874 (patch) | |
| tree | 0d46bbc434fed1d1c67d1f5135673415518b3892 /src | |
| parent | 11c492aeaff0aff251690fd2378e0cd7467cb416 (diff) | |
Sync codeword segfaults
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -44,4 +44,15 @@ mod tests { assert_eq!(errloc[0], 30); assert_eq!(errloc[1], 0); } + + #[test] + fn test_sync_codeword() { + let mut bch = BCH::init(5, 2, 1897); + let msg: [u8; 21] = [0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0]; + let ecc: [u8; 10] = [1, 0, 1, 1, 1, 0, 1, 1, 0, 0]; + let mut errloc: [u32; 2] = [0, 0]; + bch.decode(&msg, &ecc, &mut errloc); + assert_eq!(errloc[0], 0); + assert_eq!(errloc[1], 0); + } } |
