aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_block.c8
-rw-r--r--tests/test_block_header.c30
-rw-r--r--tests/test_filter_flags.c2
-rw-r--r--tests/test_index.c2
-rw-r--r--tests/test_stream_flags.c8
-rw-r--r--tests/tests.h2
6 files changed, 26 insertions, 26 deletions
diff --git a/tests/test_block.c b/tests/test_block.c
index 89063b93..01751d8c 100644
--- a/tests/test_block.c
+++ b/tests/test_block.c
@@ -44,12 +44,12 @@ main()
.has_uncompressed_size_in_footer = false,
.has_backward_size = false,
.handle_padding = false,
- .total_size = LZMA_VLI_VALUE_UNKNOWN,
- .compressed_size = LZMA_VLI_VALUE_UNKNOWN,
- .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
+ .total_size = LZMA_VLI_UNKNOWN,
+ .compressed_size = LZMA_VLI_UNKNOWN,
+ .uncompressed_size = LZMA_VLI_UNKNOWN,
.header_size = 5,
};
- block_options.filters[0].id = LZMA_VLI_VALUE_UNKNOWN;
+ block_options.filters[0].id = LZMA_VLI_UNKNOWN;
block_options.filters[0].options = NULL;
diff --git a/tests/test_block_header.c b/tests/test_block_header.c
index 28929dea..1d8e9d39 100644
--- a/tests/test_block_header.c
+++ b/tests/test_block_header.c
@@ -26,7 +26,7 @@ static lzma_block decoded_options;
static lzma_filter filters_none[1] = {
{
- .id = LZMA_VLI_VALUE_UNKNOWN,
+ .id = LZMA_VLI_UNKNOWN,
},
};
@@ -36,7 +36,7 @@ static lzma_filter filters_one[2] = {
.id = LZMA_FILTER_LZMA2,
.options = (void *)(&lzma_preset_lzma[0]),
}, {
- .id = LZMA_VLI_VALUE_UNKNOWN,
+ .id = LZMA_VLI_UNKNOWN,
}
};
@@ -55,7 +55,7 @@ static lzma_filter filters_four[5] = {
.id = LZMA_FILTER_LZMA2,
.options = (void *)(&lzma_preset_lzma[0]),
}, {
- .id = LZMA_VLI_VALUE_UNKNOWN,
+ .id = LZMA_VLI_UNKNOWN,
}
};
@@ -77,7 +77,7 @@ static lzma_filter filters_five[6] = {
.id = LZMA_FILTER_LZMA2,
.options = (void *)(&lzma_preset_lzma[0]),
}, {
- .id = LZMA_VLI_VALUE_UNKNOWN,
+ .id = LZMA_VLI_UNKNOWN,
}
};
@@ -103,7 +103,7 @@ code(void)
== decoded_options.uncompressed_size);
for (size_t i = 0; known_options.filters[i].id
- != LZMA_VLI_VALUE_UNKNOWN; ++i)
+ != LZMA_VLI_UNKNOWN; ++i)
expect(known_options.filters[i].id == filters[i].id);
for (size_t i = 0; i < LZMA_BLOCK_FILTERS_MAX; ++i)
@@ -116,8 +116,8 @@ test1(void)
{
known_options = (lzma_block){
.check = LZMA_CHECK_NONE,
- .compressed_size = LZMA_VLI_VALUE_UNKNOWN,
- .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
+ .compressed_size = LZMA_VLI_UNKNOWN,
+ .uncompressed_size = LZMA_VLI_UNKNOWN,
.filters = NULL,
};
@@ -141,11 +141,11 @@ test1(void)
known_options.compressed_size = 0; // Cannot be zero.
expect(lzma_block_header_size(&known_options) == LZMA_PROG_ERROR);
- known_options.compressed_size = LZMA_VLI_VALUE_UNKNOWN;
+ known_options.compressed_size = LZMA_VLI_UNKNOWN;
known_options.uncompressed_size = 0;
expect(lzma_block_header_size(&known_options) == LZMA_OK);
- known_options.uncompressed_size = LZMA_VLI_VALUE_MAX + 1;
+ known_options.uncompressed_size = LZMA_VLI_MAX + 1;
expect(lzma_block_header_size(&known_options) == LZMA_PROG_ERROR);
}
@@ -155,8 +155,8 @@ test2(void)
{
known_options = (lzma_block){
.check = LZMA_CHECK_CRC32,
- .compressed_size = LZMA_VLI_VALUE_UNKNOWN,
- .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
+ .compressed_size = LZMA_VLI_UNKNOWN,
+ .uncompressed_size = LZMA_VLI_UNKNOWN,
.filters = filters_four,
};
@@ -181,8 +181,8 @@ test3(void)
{
known_options = (lzma_block){
.check = LZMA_CHECK_CRC32,
- .compressed_size = LZMA_VLI_VALUE_UNKNOWN,
- .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
+ .compressed_size = LZMA_VLI_UNKNOWN,
+ .uncompressed_size = LZMA_VLI_UNKNOWN,
.filters = filters_one,
};
@@ -213,7 +213,7 @@ test3(void)
integer_write_32(buf + known_options.header_size - 4,
lzma_crc32(buf, known_options.header_size - 4, 0));
expect(lzma_block_header_decode(&decoded_options, NULL, buf)
- == LZMA_HEADER_ERROR);
+ == LZMA_OPTIONS_ERROR);
buf[2] ^= 0x1F;
// Non-nul Padding
@@ -221,7 +221,7 @@ test3(void)
integer_write_32(buf + known_options.header_size - 4,
lzma_crc32(buf, known_options.header_size - 4, 0));
expect(lzma_block_header_decode(&decoded_options, NULL, buf)
- == LZMA_HEADER_ERROR);
+ == LZMA_OPTIONS_ERROR);
buf[known_options.header_size - 4 - 1] ^= 1;
}
diff --git a/tests/test_filter_flags.c b/tests/test_filter_flags.c
index d4d309f4..585138d1 100644
--- a/tests/test_filter_flags.c
+++ b/tests/test_filter_flags.c
@@ -93,7 +93,7 @@ test_subblock(void)
buffer[0] = LZMA_FILTER_SUBBLOCK;
buffer[1] = 1;
buffer[2] = 0;
- expect(!decode_ret(3, LZMA_HEADER_ERROR));
+ expect(!decode_ret(3, LZMA_OPTIONS_ERROR));
}
#endif
diff --git a/tests/test_index.c b/tests/test_index.c
index 8623d9ab..8a88dd31 100644
--- a/tests/test_index.c
+++ b/tests/test_index.c
@@ -100,7 +100,7 @@ test_overflow(void)
// Integer overflow tests
lzma_index *i = create_empty();
- expect(lzma_index_append(i, NULL, LZMA_VLI_VALUE_MAX - 5, 1234)
+ expect(lzma_index_append(i, NULL, LZMA_VLI_MAX - 5, 1234)
== LZMA_DATA_ERROR);
// TODO
diff --git a/tests/test_stream_flags.c b/tests/test_stream_flags.c
index abd0296d..2ff216db 100644
--- a/tests/test_stream_flags.c
+++ b/tests/test_stream_flags.c
@@ -49,7 +49,7 @@ test_header_decoder(lzma_ret expected_ret)
// Header doesn't have Backward Size, so make
// lzma_stream_flags_compare() ignore it.
- decoded_flags.backward_size = LZMA_VLI_VALUE_UNKNOWN;
+ decoded_flags.backward_size = LZMA_VLI_UNKNOWN;
return validate();
}
@@ -116,7 +116,7 @@ test_encode_invalid(void)
expect(lzma_stream_footer_encode(&known_flags, buffer)
== LZMA_PROG_ERROR);
- known_flags.backward_size = LZMA_VLI_VALUE_MAX;
+ known_flags.backward_size = LZMA_VLI_MAX;
expect(lzma_stream_header_encode(&known_flags, buffer) == LZMA_OK);
@@ -147,7 +147,7 @@ test_decode_invalid(void)
buffer[6] ^= 0x20;
crc = lzma_crc32(buffer + 6, 2, 0);
integer_write_32(buffer + 8, crc);
- succeed(test_header_decoder(LZMA_HEADER_ERROR));
+ succeed(test_header_decoder(LZMA_OPTIONS_ERROR));
// Test 3 (invalid CRC32)
expect(lzma_stream_header_encode(&known_flags, buffer) == LZMA_OK);
@@ -159,7 +159,7 @@ test_decode_invalid(void)
buffer[9] ^= 0x40;
crc = lzma_crc32(buffer + 4, 6, 0);
integer_write_32(buffer, crc);
- succeed(test_footer_decoder(LZMA_HEADER_ERROR));
+ succeed(test_footer_decoder(LZMA_OPTIONS_ERROR));
// Test 5 (invalid Magic Bytes)
expect(lzma_stream_footer_encode(&known_flags, buffer) == LZMA_OK);
diff --git a/tests/tests.h b/tests/tests.h
index f00925da..49994727 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -50,7 +50,7 @@ lzma_ret_sym(lzma_ret ret)
"LZMA_MEM_ERROR",
"LZMA_MEMLIMIT_ERROR",
"LZMA_FORMAT_ERROR",
- "LZMA_HEADER_ERROR",
+ "LZMA_OPTIONS_ERROR",
"LZMA_DATA_ERROR",
"LZMA_BUF_ERROR",
"LZMA_PROG_ERROR"