From 2187b27c64ef23d6ffa2917c8d835e100969e3e6 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 20 Jul 2026 20:00:06 +0300 Subject: [PATCH] Tests: test_index: Fix testing of _locate() with concatenated lzma_index --- tests/test_index.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_index.c b/tests/test_index.c index 5501332e..d195fc17 100644 --- a/tests/test_index.c +++ b/tests/test_index.c @@ -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); }