diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-06-18 18:02:10 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-06-18 18:02:10 +0300 |
commit | 7d17818cec8597f847b0a2537fde991bbc3d9e96 (patch) | |
tree | 9c41502e3eb96f103fe98e13456b382fbba7a292 /tests/tests.h | |
parent | Update the file format specification draft. The new one is (diff) | |
download | xz-7d17818cec8597f847b0a2537fde991bbc3d9e96.tar.xz |
Update the code to mostly match the new simpler file format
specification. Simplify things by removing most of the
support for known uncompressed size in most places.
There are some miscellaneous changes here and there too.
The API of liblzma has got many changes and still some
more will be done soon. While most of the code has been
updated, some things are not fixed (the command line tool
will choke with invalid filter chain, if nothing else).
Subblock filter is somewhat broken for now. It will be
updated once the encoded format of the Subblock filter
has been decided.
Diffstat (limited to 'tests/tests.h')
-rw-r--r-- | tests/tests.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/tests.h b/tests/tests.h index c7b43fd0..89880552 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -21,13 +21,14 @@ #define LZMA_TESTS_H #include "sysdefs.h" +#include "integer.h" #include <stdio.h> #define memcrap(buf, size) memset(buf, 0xFD, size) #define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%u: %s\n", \ - __FILE__, __LINE__, #test), exit(1), 0)) + __FILE__, __LINE__, #test), abort(), 0)) #define succeed(test) expect(!(test)) @@ -71,6 +72,14 @@ lzma_ret_sym(lzma_ret ret) case LZMA_UNSUPPORTED_CHECK: str = "LZMA_UNSUPPORTED_CHECK"; break; + + case LZMA_FORMAT_ERROR: + str = "LZMA_FORMAT_ERROR"; + break; + + case LZMA_MEMLIMIT_ERROR: + str = "LZMA_MEMLIMIT_ERROR"; + break; } return str; @@ -121,8 +130,7 @@ coder_loop(lzma_stream *strm, uint8_t *in, size_t in_size, if (strm->total_in != in_size || strm->total_out != out_size) error = true; } else { - if (strm->total_in + 1 != in_size - || strm->total_out != out_size) + if (strm->total_in != in_size || strm->total_out != out_size) error = true; } |