| 70 | } |
| 71 | |
| 72 | char * RandomCharArray(int max, int *real) |
| 73 | { |
| 74 | char *tmp; |
| 75 | uint32_t n = rand() % max; |
| 76 | if (n == 0) |
| 77 | n++; |
| 78 | |
| 79 | tmp = (char *)malloc(n + 1); |
| 80 | |
| 81 | for (uint32_t j = 0; j < n; ++j) |
| 82 | { |
| 83 | char c = 'a' + (rand() % 26); |
| 84 | tmp[j] = c; |
| 85 | } |
| 86 | tmp[n] = 0; |
| 87 | |
| 88 | *real = n; |
| 89 | |
| 90 | return tmp; |
| 91 | } |
| 92 | |
| 93 | TEST(dmLZ4, Stress) |
| 94 | { |