Tests: test_filter_str: Add a few assertions

This commit is contained in:
Lasse Collin 2024-04-23 16:35:33 +03:00
parent 26c69be805
commit 3ac8a9bb4c
1 changed files with 4 additions and 0 deletions

View File

@ -598,13 +598,16 @@ test_lzma_str_list_filters(void)
// Test with bad flags.
assert_lzma_ret(lzma_str_list_filters(&str, LZMA_VLI_UNKNOWN,
LZMA_STR_NO_VALIDATION , NULL), LZMA_OPTIONS_ERROR);
assert_true(str == NULL);
assert_lzma_ret(lzma_str_list_filters(&str, LZMA_VLI_UNKNOWN,
LZMA_STR_NO_SPACES, NULL), LZMA_OPTIONS_ERROR);
assert_true(str == NULL);
// Test with bad Filter ID.
assert_lzma_ret(lzma_str_list_filters(&str, LZMA_VLI_UNKNOWN - 1,
0, NULL), LZMA_OPTIONS_ERROR);
assert_true(str == NULL);
// Test LZMA_STR_ENCODER flag.
assert_lzma_ret(lzma_str_list_filters(&str, LZMA_VLI_UNKNOWN,
@ -629,6 +632,7 @@ test_lzma_str_list_filters(void)
// Test LZMA_STR_GETOPT_LONG flag.
assert_lzma_ret(lzma_str_list_filters(&str, LZMA_VLI_UNKNOWN,
LZMA_STR_GETOPT_LONG, NULL), LZMA_OK);
assert_str_contains(str, "--");
free(str);