Generate random bytes as packed integers.
| 47 | |
| 48 | /// Generate random bytes as packed integers. |
| 49 | std::vector<uint8_t> GenerateRandomPackedValues(int32_t num_values, int32_t bit_width) { |
| 50 | constexpr uint32_t kSeed = 3214; |
| 51 | const auto num_bytes = GetNumBytes(num_values, bit_width); |
| 52 | |
| 53 | std::vector<uint8_t> out(num_bytes); |
| 54 | random_bytes(num_bytes, kSeed, out.data()); |
| 55 | |
| 56 | return out; |
| 57 | } |
| 58 | |
| 59 | const uint8_t* GetNextAlignedByte(const uint8_t* ptr, std::size_t alignment) { |
| 60 | auto addr = reinterpret_cast<std::uintptr_t>(ptr); |
no test coverage detected