| 66 | 0x3fffffff, 30}; |
| 67 | |
| 68 | void |
| 69 | random_test() |
| 70 | { |
| 71 | const int size = 1024; |
| 72 | char *dst_start = (char *)malloc(size * 2); |
| 73 | char string[size]; |
| 74 | for (char &i : string) { |
| 75 | // coverity[dont_call] |
| 76 | long num = lrand48(); |
| 77 | i = (char)num; |
| 78 | } |
| 79 | const uint8_t *src = (const uint8_t *)string; |
| 80 | uint32_t src_len = sizeof(string); |
| 81 | |
| 82 | int bytes = huffman_decode(dst_start, src, src_len); |
| 83 | |
| 84 | // cout << "bytes: " << bytes << endl; |
| 85 | for (int i = 0; i < bytes; i++) { |
| 86 | // cout << i << " " << (int)dst_start[i] << " " << dst_start[i] << endl; |
| 87 | } |
| 88 | |
| 89 | free(dst_start); |
| 90 | } |
| 91 | |
| 92 | TEST_CASE("Huffmancode Random", "[proxy][huffman]") |
| 93 | { |
no test coverage detected