]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Tests: test_microlzma: Add a "FIXME?" about LZMA_FINISH handling
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 13 Apr 2024 19:19:40 +0000 (22:19 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Sat, 13 Apr 2024 19:39:10 +0000 (22:39 +0300)
tests/test_microlzma.c

index 8da79a97210e62399e381180da43c358bdd01b64..c1d99d77fc3dc311a4cf3f2574f82b883bde6238 100644 (file)
@@ -411,7 +411,15 @@ test_decode_uncomp_size_wrong(void)
 
        // No error detected, even though all input was consumed and there
        // is more room in the output buffer.
+       //
+       // FIXME? LZMA_FINISH tells that no more input is coming and
+       // the MicroLZMA decoder knows the exact compressed size from
+       // the initialization as well. So should it return LZMA_DATA_ERROR
+       // on the first call instead of relying on the generic lzma_code()
+       // logic to eventually get LZMA_BUF_ERROR?
        assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_OK);
+       assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_OK);
+       assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_BUF_ERROR);
 
        assert_uint_eq(strm.total_out, sizeof(goodbye_world));
        assert_array_eq(goodbye_world, output, sizeof(goodbye_world));