Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
---|---|---|---|---|---|---|
1 | 1 | 0 | 0 | 0 | 100.0% | 0.089 seconds |
Bit-level error emulator
Simulate the sending through a poor internet connection making one-bit errors in every byte of the text
should make an error in one bit per byte
Return
|
|||||||||||||
Given:
|
text as byte array
|
||||||||||||
def data = text.bytes |
|||||||||||||
When:
|
we use error emulator coder
|
||||||||||||
def out = coder.apply(data) |
|||||||||||||
Then:
|
we have one-bit errors in every byte of the data
|
||||||||||||
(0..<data.length).every { (out[it] ^ data[it]) in ONE_BIT_ERRORS } |
|||||||||||||
Examples:
|
|
5/5 passed
|