| 129 | } |
| 130 | |
| 131 | boost::shared_array<uint8_t> gen_random_buffer(uint32_t buf_len) { |
| 132 | auto* buf = new uint8_t[buf_len]; |
| 133 | |
| 134 | boost::uniform_smallint<uint8_t> distribution(0, UINT8_MAX); |
| 135 | boost::variate_generator<boost::mt19937, boost::uniform_smallint<uint8_t> > |
| 136 | generator(rng, distribution); |
| 137 | |
| 138 | for (uint32_t n = 0; n < buf_len; ++n) { |
| 139 | buf[n] = generator(); |
| 140 | } |
| 141 | |
| 142 | return boost::shared_array<uint8_t>(buf); |
| 143 | } |
| 144 | |
| 145 | /* |
| 146 | * Test functions |
no outgoing calls
no test coverage detected