]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Tests: test_filter_str: Move one assertion and add a comment
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 23 Apr 2024 13:35:08 +0000 (16:35 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:12:07 +0000 (00:12 +0300)
(cherry picked from commit 26c69be80523b05c84dea86c47c4ddd9a10945d7)

tests/test_filter_str.c

index f88404f23b49b7dfcd63303e9c1d0aa802571d0d..d37666dfa1501039e6806dd871ead60c6ad94a83 100644 (file)
@@ -437,6 +437,10 @@ test_lzma_str_from_filters(void)
        assert_true(lzma_str_to_filters("x86 lzma2", NULL, filters, 0, NULL)
                        == NULL);
 
+       // It always allocates the options structure even when it's not
+       // needed due to start_offset = 0 being the default.
+       assert_true(filters[0].options != NULL);
+
        assert_lzma_ret(lzma_str_from_filters(&output_str, filters, 0, NULL),
                        LZMA_OK);
 
@@ -445,9 +449,7 @@ test_lzma_str_from_filters(void)
        free(output_str);
 
        // Test setting BCJ option to NULL.
-       assert_false(filters[0].options == NULL);
        free(filters[0].options);
-
        filters[0].options = NULL;
 
        assert_lzma_ret(lzma_str_from_filters(&output_str, filters, 0, NULL),