MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / test_conversions

Function test_conversions

tests/greaseweazle.cc:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42static void test_conversions()
43{
44 /* Simple one-byte intervals. */
45
46 test_convert(Bytes{1, 1, 1, 1, 0}, Bytes{0x82, 0x82, 0x82, 0x82});
47
48 /* Larger one-byte intervals. */
49
50 test_convert(Bytes{32, 0}, Bytes{0x3f, 0x81});
51
52 test_convert(Bytes{64, 0}, Bytes{0x3f, 0x3f, 0x82});
53
54 test_convert(Bytes{128, 0}, Bytes{0x3f, 0x3f, 0x3f, 0x3f, 0x84});
55
56 /* Two-byte intervals. */
57
58 test_convert(Bytes{250, 1, 0},
59 Bytes{0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xbb});
60
61 /* Very long intervals. */
62
63 test_convert(Bytes{255, FLUXOP_SPACE, E28(2048 - 249), 249, 0},
64 Bytes{0x3f} * 0x41 + Bytes{0x81});
65}
66
67int main(int argc, const char* argv[])
68{

Callers 1

mainFunction · 0.85

Calls 1

test_convertFunction · 0.70

Tested by

no test coverage detected