| 22 | } |
| 23 | |
| 24 | TEST(binaryToString, zeroStart) { |
| 25 | // a, b, c are printable, 1 & 4 are not => '.', 0 at last position => skipped |
| 26 | checkBinaryToString(makeSlice(b, 0, 6), "abc.."); |
| 27 | |
| 28 | // same as previous, but now last element is not ignored since it is not 0 |
| 29 | checkBinaryToString(makeSlice(b, 0, 5), "abc.."); |
| 30 | |
| 31 | // same as first, only now the 0 & 136 are converted to '.' |
| 32 | checkBinaryToString(makeSlice(b, 0, 8), "abc...e."); |
| 33 | |
| 34 | // should result in the same as previously, as trailing zero is ignored |
| 35 | checkBinaryToString(makeSlice(b, 0, 9), "abc...e."); |
| 36 | |
| 37 | // ensure that the function does not overread when last element != 0 |
| 38 | checkBinaryToString(makeSlice(b, 0, sizeof(b)), "abc...e..a"); |
| 39 | } |
| 40 | |
| 41 | TEST(binaryToString, nonZeroStart) { |
| 42 | // start @ index 1, read 6 characters (until e) |
nothing calls this directly
no test coverage detected