diff options
author | Mathis Rosenhauer <rosenhauer@dkrz.de> | 2012-10-04 17:22:35 +0200 |
---|---|---|
committer | Thomas Jahns <jahns@dkrz.de> | 2013-02-19 11:33:00 +0100 |
commit | b63f830b39d9d6f344bc36eedf0d46d046227474 (patch) | |
tree | 97ad3fb00736a1be4278bc44d7db07a1fc8d3774 /tests | |
parent | 74ea5524e97bd55d5ca1905702b474930e22b4ca (diff) | |
download | libaec-b63f830b39d9d6f344bc36eedf0d46d046227474.tar.gz libaec-b63f830b39d9d6f344bc36eedf0d46d046227474.tar.bz2 libaec-b63f830b39d9d6f344bc36eedf0d46d046227474.zip |
Fix another zero block bug with check
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check_code_options.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/check_code_options.c b/tests/check_code_options.c index 12b328f..befb72b 100644 --- a/tests/check_code_options.c +++ b/tests/check_code_options.c @@ -9,21 +9,26 @@ int check_block_sizes(struct test_state *state, int id, int id_len) { - int bs, status; + int bs, status, rsi, max_rsi; for (bs = 8; bs <= 64; bs *= 2) { state->strm->block_size = bs; - state->strm->rsi = state->buf_len - / (bs * state->byte_per_sample); - status = encode_decode(state); - if (status) - return status; + max_rsi = state->buf_len / (bs * state->byte_per_sample); + if (max_rsi > 4096) + max_rsi = 4096; + + for (rsi = 1; rsi <= max_rsi; rsi++) { + state->strm->rsi = rsi; + status = encode_decode(state); + if (status) + return status; - if ((state->cbuf[0] >> (8 - id_len)) != id) { - printf("FAIL: Unexpected block of size %i created %x.\n", - bs, state->cbuf[0] >> (8 - id_len)); - return 99; + if ((state->cbuf[0] >> (8 - id_len)) != id) { + printf("FAIL: Unexpected block of size %i created ID:%x.\n", + bs, state->cbuf[0] >> (8 - id_len)); + return 99; + } } } return 0; |