|
|
|
|
@ -71,10 +71,10 @@ static void fixture_init(struct fixture *f, unsigned n, unsigned r, size_t block
|
|
|
|
|
f->input_size = rs_input_size(f->ctx); |
|
|
|
|
CHECK(f->input_size == f->k * (block_size - RS_HEADER_SIZE)); |
|
|
|
|
f->storage_size = n * (block_size + 2 * GUARD); |
|
|
|
|
f->input_storage = u_malloc(f->input_size + 2 * GUARD); |
|
|
|
|
f->output_storage = u_malloc(f->input_size + 2 * GUARD); |
|
|
|
|
f->storage = u_malloc(f->storage_size); |
|
|
|
|
f->saved = u_malloc(f->storage_size); |
|
|
|
|
f->input_storage = u_malloc((uint32_t)(f->input_size + 2 * GUARD)); |
|
|
|
|
f->output_storage = u_malloc((uint32_t)(f->input_size + 2 * GUARD)); |
|
|
|
|
f->storage = u_malloc((uint32_t)f->storage_size); |
|
|
|
|
f->saved = u_malloc((uint32_t)f->storage_size); |
|
|
|
|
CHECK(f->input_storage && f->output_storage && f->storage && f->saved); |
|
|
|
|
memset(f->input_storage, MARKER, f->input_size + 2 * GUARD); |
|
|
|
|
memset(f->output_storage, MARKER, f->input_size + 2 * GUARD); |
|
|
|
|
@ -293,8 +293,8 @@ static void test_stream(void) {
|
|
|
|
|
struct fixture f; |
|
|
|
|
fixture_init(&f, 16, 2, 101, 0); |
|
|
|
|
size_t length = 3 * f.input_size + 17; |
|
|
|
|
uint8_t *source = u_malloc(length); |
|
|
|
|
uint8_t *result = u_malloc(length); |
|
|
|
|
uint8_t *source = u_malloc((uint32_t)length); |
|
|
|
|
uint8_t *result = u_malloc((uint32_t)length); |
|
|
|
|
CHECK(source && result); |
|
|
|
|
for (size_t i = 0; i < length; i++) source[i] = (uint8_t)(i * 17 + i / 251); |
|
|
|
|
size_t offset = 0; |
|
|
|
|
|