mirror of
				https://git.tukaani.org/xz.git
				synced 2025-10-31 13:32:56 +00:00 
			
		
		
		
	Tests: test_index: Fix failures when features are disabled
Fixes: cd88423e76d54eb72aea037364f3ebb21f122503 (cherry picked from commit 710a4573ef2cbd19c66318c3b2d1388e418e26c7)
This commit is contained in:
		
							parent
							
								
									8ace8b9c97
								
							
						
					
					
						commit
						2d14bf53b9
					
				| @ -25,8 +25,11 @@ | ||||
| 
 | ||||
| #define MEMLIMIT (UINT64_C(1) << 20) | ||||
| 
 | ||||
| #ifdef HAVE_ENCODERS | ||||
| static uint8_t *decode_buffer; | ||||
| static size_t decode_buffer_size = 0; | ||||
| #endif | ||||
| 
 | ||||
| static lzma_index *decode_test_index; | ||||
| 
 | ||||
| 
 | ||||
| @ -1506,7 +1509,7 @@ generate_index_decode_buffer(void) | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| #ifdef HAVE_DECODERS | ||||
| #if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) | ||||
| static void | ||||
| decode_index(const uint8_t *buffer, const size_t size, lzma_stream *strm, | ||||
| 		lzma_ret expected_error) | ||||
| @ -1521,8 +1524,8 @@ decode_index(const uint8_t *buffer, const size_t size, lzma_stream *strm, | ||||
| static void | ||||
| test_lzma_index_decoder(void) | ||||
| { | ||||
| #ifndef HAVE_DECODERS | ||||
| 	assert_skip("Decoder support disabled"); | ||||
| #if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) | ||||
| 	assert_skip("Encoder or decoder support disabled"); | ||||
| #else | ||||
| 	assert_true(decode_buffer_size != 0); | ||||
| 
 | ||||
| @ -1660,8 +1663,8 @@ test_lzma_index_buffer_encode(void) | ||||
| static void | ||||
| test_lzma_index_buffer_decode(void) | ||||
| { | ||||
| #ifndef HAVE_DECODERS | ||||
| 	assert_skip("Decoder support disabled"); | ||||
| #if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) | ||||
| 	assert_skip("Encoder or decoder support disabled"); | ||||
| #else | ||||
| 	assert_true(decode_buffer_size != 0); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user