]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Tests: Fix unused function warning in test_block_header.
authorJia Tan <jiat0218@gmail.com>
Tue, 10 Jan 2023 17:18:50 +0000 (01:18 +0800)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 11 Jan 2023 15:31:54 +0000 (17:31 +0200)
One of the global arrays of filters was only used in a test that
required both encoders and decoders to be configured in the build.

tests/test_block_header.c

index 6b42df22c5f4b4b1a37c9b288886f1364d2b83b7..747925b346cabf2e8ae10bd80069c7e0a2796b54 100644 (file)
@@ -35,6 +35,9 @@ static lzma_filter filters_one[2] = {
 };
 
 
+// These filters are only used in test_lzma_block_header_decode()
+// which only runs if encoders and decoders are configured.
+#ifdef HAVE_DECODERS
 static lzma_filter filters_four[5] = {
        {
                .id = LZMA_FILTER_X86,
@@ -52,6 +55,7 @@ static lzma_filter filters_four[5] = {
                .id = LZMA_VLI_UNKNOWN,
        }
 };
+#endif
 
 
 static lzma_filter filters_five[6] = {