diff --git a/tests/test_bcj_exact_size.c b/tests/test_bcj_exact_size.c index 551166cb..2faf3843 100644 --- a/tests/test_bcj_exact_size.c +++ b/tests/test_bcj_exact_size.c @@ -96,7 +96,7 @@ test_empty_block(void) // An empty file with one Block using PowerPC BCJ and LZMA2. size_t in_size; uint8_t *empty_bcj_lzma2 = tuktest_file_from_srcdir( - "files/good-1-empty-bcj-lzma2.xz", &in_size); + "tests/files/good-1-empty-bcj-lzma2.xz", &in_size); // Decompress without giving any output space. uint64_t memlimit = 1 << 20; diff --git a/tests/test_check.c b/tests/test_check.c index cb1ad251..fd55e313 100644 --- a/tests/test_check.c +++ b/tests/test_check.c @@ -358,25 +358,25 @@ main(int argc, char **argv) tuktest_start(argc, argv); no_check_xz_data = tuktest_file_from_srcdir( - "files/good-1-check-none.xz", &no_check_size); + "tests/files/good-1-check-none.xz", &no_check_size); unsupported_check_xz_data = tuktest_file_from_srcdir( - "files/unsupported-check.xz", + "tests/files/unsupported-check.xz", &unsupported_check_size); #ifdef HAVE_CHECK_CRC32 crc32_xz_data = tuktest_file_from_srcdir( - "files/good-1-check-crc32.xz", &crc32_size); + "tests/files/good-1-check-crc32.xz", &crc32_size); #endif #ifdef HAVE_CHECK_CRC64 crc64_xz_data = tuktest_file_from_srcdir( - "files/good-1-check-crc64.xz", &crc64_size); + "tests/files/good-1-check-crc64.xz", &crc64_size); #endif #ifdef HAVE_CHECK_SHA256 sha256_xz_data = tuktest_file_from_srcdir( - "files/good-1-check-sha256.xz", &sha256_size); + "tests/files/good-1-check-sha256.xz", &sha256_size); #endif tuktest_run(test_lzma_crc32); diff --git a/tests/test_lzip_decoder.c b/tests/test_lzip_decoder.c index 3743d434..3dfa42a9 100644 --- a/tests/test_lzip_decoder.c +++ b/tests/test_lzip_decoder.c @@ -101,7 +101,7 @@ test_v0_decode(void) // This tests if liblzma can decode lzip version 0 files. // lzip 1.17 and older can decompress this, but lzip 1.18 // and newer can no longer decode these files. - basic_lzip_decode("files/good-1-v0.lz", hello_world_crc); + basic_lzip_decode("tests/files/good-1-v0.lz", hello_world_crc); } @@ -109,7 +109,7 @@ static void test_v1_decode(void) { // This tests decoding a basic lzip v1 file - basic_lzip_decode("files/good-1-v1.lz", hello_world_crc); + basic_lzip_decode("tests/files/good-1-v1.lz", hello_world_crc); } @@ -205,7 +205,7 @@ decode_expect_error(const char *src, lzma_ret expected_error) static void test_v0_trailing(void) { - trailing_helper("files/good-1-v0-trailing-1.lz", hello_world_crc, + trailing_helper("tests/files/good-1-v0-trailing-1.lz", hello_world_crc, trailing_garbage_crc); } @@ -213,21 +213,21 @@ test_v0_trailing(void) static void test_v1_trailing(void) { - trailing_helper("files/good-1-v1-trailing-1.lz", hello_world_crc, + trailing_helper("tests/files/good-1-v1-trailing-1.lz", hello_world_crc, trailing_garbage_crc); - // The second files/good-1-v1-trailing-2.lz will have the same + // The second tests/files/good-1-v1-trailing-2.lz will have the same // expected output and trailing output as - // files/good-1-v1-trailing-1.lz, but this tests if the prefix + // tests/files/good-1-v1-trailing-1.lz, but this tests if the prefix // to the trailing data contains lzip magic bytes. // When this happens, the expected behavior is to silently ignore // the magic byte prefix and consume it from the input file. - trailing_helper("files/good-1-v1-trailing-2.lz", hello_world_crc, + trailing_helper("tests/files/good-1-v1-trailing-2.lz", hello_world_crc, trailing_garbage_crc); // Expect LZMA_BUF error if a file ends with the lzip magic bytes // but does not contain any data after - decode_expect_error("files/bad-1-v1-trailing-magic.lz", + decode_expect_error("tests/files/bad-1-v1-trailing-magic.lz", LZMA_BUF_ERROR); } @@ -241,7 +241,7 @@ test_concatentated(void) lzma_stream strm = LZMA_STREAM_INIT; size_t file_size; - uint8_t *v0_v1 = tuktest_file_from_srcdir("files/good-2-v0-v1.lz", + uint8_t *v0_v1 = tuktest_file_from_srcdir("tests/files/good-2-v0-v1.lz", &file_size); assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, @@ -262,7 +262,7 @@ test_concatentated(void) assert_uint_eq(checksum, hello_world_crc); // The second file contains one v1 member and one v2 member - uint8_t *v1_v0 = tuktest_file_from_srcdir("files/good-2-v1-v0.lz", + uint8_t *v1_v0 = tuktest_file_from_srcdir("tests/files/good-2-v1-v0.lz", &file_size); assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, @@ -280,7 +280,7 @@ test_concatentated(void) assert_uint_eq(checksum, hello_world_crc); // The third file contains 2 v1 members - uint8_t *v1_v1 = tuktest_file_from_srcdir("files/good-2-v1-v1.lz", + uint8_t *v1_v1 = tuktest_file_from_srcdir("tests/files/good-2-v1-v1.lz", &file_size); assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, @@ -307,7 +307,7 @@ test_crc(void) // Test invalid checksum lzma_stream strm = LZMA_STREAM_INIT; size_t file_size; - uint8_t *data = tuktest_file_from_srcdir("files/bad-1-v1-crc32.lz", + uint8_t *data = tuktest_file_from_srcdir("tests/files/bad-1-v1-crc32.lz", &file_size); assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, @@ -385,7 +385,7 @@ test_invalid_version(void) { // The file contains a version number that is not 0 or 1, // so it should cause an error - decode_expect_error("files/unsupported-1-v234.lz", + decode_expect_error("tests/files/unsupported-1-v234.lz", LZMA_OPTIONS_ERROR); } @@ -394,10 +394,10 @@ static void test_invalid_dictionary_size(void) { // First file has too small dictionary size field - decode_expect_error("files/bad-1-v1-dict-1.lz", LZMA_DATA_ERROR); + decode_expect_error("tests/files/bad-1-v1-dict-1.lz", LZMA_DATA_ERROR); // Second file has too large dictionary size field - decode_expect_error("files/bad-1-v1-dict-2.lz", LZMA_DATA_ERROR); + decode_expect_error("tests/files/bad-1-v1-dict-2.lz", LZMA_DATA_ERROR); } @@ -405,11 +405,11 @@ static void test_invalid_uncomp_size(void) { // Test invalid v0 lzip file uncomp size - decode_expect_error("files/bad-1-v0-uncomp-size.lz", + decode_expect_error("tests/files/bad-1-v0-uncomp-size.lz", LZMA_DATA_ERROR); // Test invalid v1 lzip file uncomp size - decode_expect_error("files/bad-1-v1-uncomp-size.lz", + decode_expect_error("tests/files/bad-1-v1-uncomp-size.lz", LZMA_DATA_ERROR); } @@ -417,7 +417,7 @@ test_invalid_uncomp_size(void) static void test_invalid_member_size(void) { - decode_expect_error("files/bad-1-v1-member-size.lz", + decode_expect_error("tests/files/bad-1-v1-member-size.lz", LZMA_DATA_ERROR); } @@ -428,7 +428,7 @@ test_invalid_memlimit(void) // A very low memlimit should prevent decoding. // Should be able to update the memlimit after failing size_t file_size; - uint8_t *data = tuktest_file_from_srcdir("files/good-1-v1.lz", + uint8_t *data = tuktest_file_from_srcdir("tests/files/good-1-v1.lz", &file_size); uint8_t output_buffer[DECODE_CHUNK_SIZE]; diff --git a/tests/test_memlimit.c b/tests/test_memlimit.c index c45a44b5..09bf82c5 100644 --- a/tests/test_memlimit.c +++ b/tests/test_memlimit.c @@ -104,7 +104,7 @@ test_memlimit_alone_decoder(void) #else size_t alone_size; uint8_t *alone_buf = tuktest_file_from_srcdir( - "files/good-unknown_size-with_eopm.lzma", &alone_size); + "tests/files/good-unknown_size-with_eopm.lzma", &alone_size); lzma_stream strm = LZMA_STREAM_INIT; assert_lzma_ret(lzma_alone_decoder(&strm, MEMLIMIT_TOO_LOW), LZMA_OK); @@ -162,7 +162,7 @@ main(int argc, char **argv) { tuktest_start(argc, argv); - in = tuktest_file_from_srcdir("files/good-1-check-crc32.xz", &in_size); + in = tuktest_file_from_srcdir("tests/files/good-1-check-crc32.xz", &in_size); tuktest_run(test_memlimit_stream_decoder); tuktest_run(test_memlimit_stream_decoder_mt);