From 94a462850bc8718f5dd5b30116bce2165b2403c2 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 23 Apr 2024 16:35:33 +0300 Subject: [PATCH] Tests: test_filter_str: Add a few assertions (cherry picked from commit 3ac8a9bb4cccbee88350696dc9c645c48d77c989) --- tests/test_filter_str.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_filter_str.c b/tests/test_filter_str.c index 686dd77e..42d9a22c 100644 --- a/tests/test_filter_str.c +++ b/tests/test_filter_str.c @@ -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);