summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Remove unused macros and functions.Jia Tan2023-03-131-75/+0
|
* liblzma: Defines masks for return values from lzma_index_checks().Jia Tan2023-03-131-11/+11
|
* Tests: Refactors existing lzma_index tests.Jia Tan2023-03-131-544/+1492
| | | | | | Converts the existing lzma_index tests into tuktests and covers every API function from index.h except for lzma_file_info_decoder, which can be tested in the future.
* Tests: Small tweak to test-vli.c.Jia Tan2023-02-241-0/+2
| | | | | | The static global variables can be disabled if encoders and decoders are not built. If they are not disabled and -Werror is used, it will cause an usused warning as an error.
* Tests: Create test_filter_str.c.Jia Tan2023-02-032-0/+595
| | | | | Tests lzma_str_to_filters(), lzma_str_from_filters(), and lzma_str_list_filters() API functions.
* Tests: Fix warnings from clang --Wassign-enum.Lasse Collin2023-01-124-8/+17
| | | | | | | | | | | Explicitly casting the integer to lzma_check silences the warning. Since such an invalid value is needed in multiple tests, a constant INVALID_LZMA_CHECK_ID was added to tests.h. The use of 0x1000 for lzma_block.check wasn't optimal as if the underlying type is a char then 0x1000 will be truncated to 0. However, in these test cases the value is ignored, thus even with such truncation the test would have passed.
* Tests: Silence warnings from -Wsign-conversion.Lasse Collin2023-01-122-8/+8
| | | | | | | Note that assigning an unsigned int to lzma_check doesn't warn on GNU/Linux x86-64 since the enum type is unsigned on that platform. The enum can be signed on some other platform though so it's best to use enumeration type lzma_check in these situations.
* Tests: test_lzip_decoder: Remove trailing white-space.Lasse Collin2023-01-121-2/+2
|
* Tests: test_lzip_decoder: Silence warnings from -Wsign-conversion.Lasse Collin2023-01-121-6/+7
|
* Tests: Fix test_filter_flags copy/paste error.Jia Tan2023-01-111-2/+2
|
* Tests: Fix type-limits warning in test_filter_flags.Jia Tan2023-01-111-3/+10
| | | | | | | This only occurs in test_filter_flags when the BCJ filters are not configured and built. In this case, ARRAY_SIZE() returns 0 and causes a type-limits warning with the loop variable since an unsigned number will always be >= 0.
* Tests: Fix unused function warning in test_block_header.Jia Tan2023-01-111-0/+4
| | | | | 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: Fix unused function warning in test_index_hash.Jia Tan2023-01-111-3/+1
| | | | | test_index_hash does not use fill_index_hash() unless both encoders and decoders are configured in the build.
* Tests: test_filter_flags: Clean up minor issues.Lasse Collin2023-01-091-75/+78
| | | | | | | | | | | | | | | | | | | | Here are the list of the most significant issues addressed: - Avoid using internal common.h header. It's not good to copy the constants like this but common.h cannot be included for use outside of liblzma. This is the quickest thing to do that could be fixed later. - Omit the INIT_FILTER macro. Initialization should be done with just regular designated initializers. - Use start_offset = 257 for BCJ tests. It demonstrates that Filter Flags encoder and decoder don't validate the options thoroughly. 257 is valid only for the x86 filter. This is a bit silly but not a significant problem in practice because the encoder and decoder initialization functions will catch bad alignment still. Perhaps this should be fixed but it's not urgent and doesn't need to be in 5.4.x. - Various tweaks to comments such as filter id -> Filter ID
* Tests: Refactors existing filter flags tests.Jia Tan2023-01-091-198/+457
| | | | Converts the existing filter flags tests into tuktests.
* Tests: tuktest.h: Support tuktest_malloc(0).Lasse Collin2023-01-081-2/+2
| | | | | | It's not needed in XZ Utils at least for now. It's good to support it still because if such use is needed later, it wouldn't be caught on GNU/Linux since malloc(0) from glibc returns non-NULL.
* Merge pull request #7 from tukaani-project/tuktest_index_hashJia Tan2023-01-072-0/+391
|\ | | | | Tuktest index hash
| * Tests: test_index_hash: Add an assert_uint_eq().Lasse Collin2023-01-061-0/+3
| |
| * Tests: test_index_hash: Fix a memory leak.Lasse Collin2023-01-061-0/+2
| |
| * Tests: test_index_hash: Don't treat pointers as booleans.Lasse Collin2023-01-061-3/+3
| |
| * Tests: test_index_hash: Fix a typo in a comment.Lasse Collin2023-01-061-1/+1
| |
| * Tests: test_index_hash: Avoid the variable name "index".Lasse Collin2023-01-061-8/+8
| | | | | | | | It can trigger warnings from -Wshadow on some systems.
| * Tests: test_index_hash: Use the word "Record" instead of "entry".Lasse Collin2023-01-061-51/+51
| |
| * Tests: test_index_hash: Tweak comments and style.Lasse Collin2023-01-061-29/+33
| | | | | | | | | | | | The words defined in the .xz file format specification begin with capital letter to emphasize that they have a specific meaning.
| * Tests: test_index_hash: Use INDEX_INDICATOR constant instead of 0.Lasse Collin2023-01-061-1/+1
| |
| * Tests: Creates test_index_hash.cJia Tan2023-01-022-0/+382
| | | | | | | | | | Tests all API functions exported from index_hash.h. Does not have a dedicated test for lzma_index_hash_end.
* | Tests: Adjust style in test_compress.sh.Lasse Collin2023-01-041-5/+7
| |
* | Tests: Replace non portable shell parameter expansionJia Tan2023-01-044-10/+16
|/ | | | | The shell parameter expansion using # and ## is not supported in Solaris 10 Bourne shell (/bin/sh). Even though this is POSIX, it is not fully portable, so we should avoid it.
* Tests: test_check: Test corner cases of CLMUL CRC64.Lasse Collin2022-12-301-0/+27
|
* Tests: Clarify a comment in test_lzip_decoder.c.Lasse Collin2022-12-301-2/+6
|
* Tests: Adds lzip decoder testsJia Tan2022-12-302-0/+473
|
* Tests: Fix a typo in tests/files/README.Lasse Collin2022-12-131-1/+1
|
* Tests: Add two ARM64 test files.Lasse Collin2022-12-134-0/+12
|
* Tests: Test the .lz files in test_files.sh.Lasse Collin2022-11-091-0/+25
|
* Tests: Add .lz (lzip) test files.Lasse Collin2022-11-0919-11/+98
|
* Tests: test_files.sh: Make it not fail if features were disabled at build.Lasse Collin2022-10-271-4/+46
| | | | | | | It now tries to test as many files as easily possible. The exit status indicates skipping if any of the files were skipped. This way it is easy to notice if something is being skipped when it isn't expected.
* Tests: test_files.sh: Suppress an expected warning from the log.Lasse Collin2022-10-271-2/+2
| | | | | | | | | | xz (but not xzdec) will normally warn about unsupported check but since we are testing specifically such a file, it's better to silence that warning so that it doesn't look suspicious in test_files.sh.log. The use of -q and -Q in xzdec is just for consistency and doesn't affect the result at least for now.
* Tests: test_files.sh: Print the reason for skipping if xz & xzdec missing.Lasse Collin2022-10-271-0/+1
|
* Tests: Keep test_compress_* working when some filters are unavailable.Lasse Collin2022-10-271-14/+20
|
* Tests: test_bcj_exact_size skips properly now if PowerPC filter disabled.Jia Tan2022-10-261-0/+3
|
* Tests: Test also unsupported-*.xz.Lasse Collin2022-10-261-0/+37
|
* Tests: Skip tests in test_*.sh if encoders and/or decoders are disabled.Lasse Collin2022-10-193-0/+34
| | | | | | | | | | | | | | | This isn't perfect as the scripts can still fail if only certain filters are disabled. This is still an improvement as now "make check" has better behavior when all encoders or decoders are disabled. Grepping ../config.h is simple and fairly clean but it only works if config.h was created. CMake builds don't create config.h but they don't use these test scripts either. Thanks to Sebastian Andrzej Siewior for reporting the problem. Thanks to Jia Tan for the original patch which grepped xz error messages instead of config.h.
* Test: Remove the (exit 1) lines.Lasse Collin2022-10-193-25/+0
| | | | | | | | I suspect that I used these in the original version because Autoconf's manual describes that such a trick is needed in some specific situations for portability reasons. None of those situations listed on Autoconf 2.71 manual apply to these test scripts though so this cleans them up.
* Tests: Fix a warning in test_memlimit.c when decoders are disabled.Lasse Collin2022-10-191-0/+3
|
* Tests: Refactor test_stream_flags.c.Jia Tan2022-10-061-117/+416
| | | | | | | Converts test_stream_flags to tuktest. Also the test will now compile and skip properly if encoders or decoders are disabled. Thanks to Sebastian Andrzej Siewior.
* Tests: Refactor test_block_header.c.Jia Tan2022-10-061-116/+370
| | | | | | | | test_block_header now achieves higher test coverage. Also the test will now compile and skip properly if encoders or decoders are disabled. Thanks to Sebastian Andrzej Siewior.
* Tests: Fix compilation issues.Jia Tan2022-10-066-9/+56
| | | | | | | | | test_bcj_exact_size, test_check, test_hardware, and test_index will all now compile and skip properly if encoders or decoders are disabled. Also fixed a small typo (disabed -> disabled). Thanks to Sebastian Andrzej Siewior.
* Tests: Include mythread.h in the tests that use MYTHREAD_ENABLED.Lasse Collin2022-10-053-0/+3
|
* Tests: Fix compilation error when threading support has been disabled.Jia Tan2022-10-053-0/+12
| | | | | | | Now tests that require threading are skipped when threading support has been disabled. Thanks to Sebastian Andrzej Siewior.
* Tests: Create a test for the lzma_index_cat bug.Jia Tan2022-09-281-1/+42
|