MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / TEST

Function TEST

unitTests/test_image_int.cpp:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24TEST(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
41TEST(binaryToString, nonZeroStart) {
42 // start @ index 1, read 6 characters (until e)

Callers

nothing calls this directly

Calls 2

checkBinaryToStringFunction · 0.85
makeSliceFunction · 0.50

Tested by

no test coverage detected