aboutsummaryrefslogtreecommitdiff
path: root/tests/test_index.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_index.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_index.c b/tests/test_index.c
index d9e63dd0..31b958d5 100644
--- a/tests/test_index.c
+++ b/tests/test_index.c
@@ -211,6 +211,7 @@ test_read(lzma_index *i)
static void
test_code(lzma_index *i)
{
+#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS)
const size_t alloc_size = 128 * 1024;
uint8_t *buf = malloc(alloc_size);
expect(buf != NULL);
@@ -275,6 +276,9 @@ test_code(lzma_index *i)
lzma_index_end(d, NULL);
free(buf);
+#else
+ (void)i;
+#endif
}
@@ -633,6 +637,7 @@ test_locate(void)
static void
test_corrupt(void)
{
+#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS)
const size_t alloc_size = 128 * 1024;
uint8_t *buf = malloc(alloc_size);
expect(buf != NULL);
@@ -668,6 +673,7 @@ test_corrupt(void)
lzma_end(&strm);
free(buf);
+#endif
}