1
0
mirror of https://git.tukaani.org/xz.git synced 2026-10-31 03:14:56 +00:00

Tests: test_index: Fix testing of _locate() with concatenated lzma_index

This commit is contained in:
Lasse Collin 2026-07-20 20:00:06 +03:00
parent 8d13dd61ec
commit 2187b27c64
No known key found for this signature in database
GPG Key ID: 38EE757D69184620

View File

@ -1175,6 +1175,17 @@ test_lzma_index_iter_locate(void)
LZMA_STREAM_HEADER_SIZE + group_multiple * 8);
assert_uint_eq(iter.block.uncompressed_file_offset, 0);
lzma_index *idx2 = lzma_index_init(NULL);
assert_true(idx != NULL);
assert_lzma_ret(lzma_index_append(idx2, NULL, 16, 1), LZMA_OK);
assert_lzma_ret(lzma_index_cat(idx, idx2, NULL), LZMA_OK);
assert_false(lzma_index_iter_locate(&iter, 0));
assert_uint_eq(iter.block.total_size, 16);
assert_uint_eq(iter.block.uncompressed_size, 1);
assert_uint_eq(iter.block.compressed_file_offset,
LZMA_STREAM_HEADER_SIZE + group_multiple * 8);
assert_uint_eq(iter.block.uncompressed_file_offset, 0);
lzma_index_end(idx, NULL);
}