Rizin
unix-like reverse engineering framework and cli tools
|
Tests functions handling the lzma_index structure. More...
#include "tests.h"
Go to the source code of this file.
Macros | |
#define | MEMLIMIT (LZMA_VLI_C(1) << 20) |
#define | SMALL_COUNT 3 |
#define | BIG_COUNT 5555 |
Functions | |
static lzma_index * | create_empty (void) |
static lzma_index * | create_small (void) |
static lzma_index * | create_big (void) |
static bool | is_equal (const lzma_index *a, const lzma_index *b) |
static void | test_equal (void) |
static void | test_overflow (void) |
static void | test_copy (const lzma_index *i) |
static void | test_read (lzma_index *i) |
static void | test_code (lzma_index *i) |
static void | test_many (lzma_index *i) |
static void | test_cat (void) |
static void | test_locate (void) |
static void | test_corrupt (void) |
static void * | my_alloc (void *opaque, size_t a, size_t b) |
int | main (void) |
Variables | |
static const lzma_allocator | my_allocator = { &my_alloc, NULL, NULL } |
Tests functions handling the lzma_index structure.
Definition in file test_index.c.
#define BIG_COUNT 5555 |
Definition at line 18 of file test_index.c.
#define MEMLIMIT (LZMA_VLI_C(1) << 20) |
Definition at line 15 of file test_index.c.
#define SMALL_COUNT 3 |
Definition at line 17 of file test_index.c.
|
static |
Definition at line 43 of file test_index.c.
References BIG_COUNT, expect, i, LZMA_OK, LZMA_STREAM_HEADER_SIZE, LZMA_VLI_C, n, NULL, and uncompressed_size.
Referenced by main(), test_cat(), and test_equal().
|
static |
Definition at line 22 of file test_index.c.
References expect, i, and NULL.
Referenced by main(), test_cat(), test_corrupt(), test_equal(), and test_overflow().
|
static |
Definition at line 31 of file test_index.c.
References expect, i, LZMA_OK, and NULL.
Referenced by main(), test_cat(), test_corrupt(), and test_equal().
|
static |
Definition at line 73 of file test_index.c.
References a, b, lzma_index_iter::block, lzma_index_iter::block_count, lzma_index_iter::compressed_file_offset, lzma_index_iter::compressed_offset, lzma_index_iter::compressed_size, lzma_index_iter::compressed_stream_offset, LZMA_INDEX_ITER_ANY, lzma_index_iter::number, lzma_index_iter::number_in_file, lzma_index_iter::number_in_stream, lzma_index_iter::padding, lzma_index_iter::stream, lzma_index_iter::total_size, lzma_index_iter::uncompressed_file_offset, lzma_index_iter::uncompressed_offset, lzma_index_iter::uncompressed_size, lzma_index_iter::uncompressed_stream_offset, and lzma_index_iter::unpadded_size.
Referenced by test_code(), test_copy(), and test_equal().
int main | ( | void | ) |
Definition at line 650 of file test_index.c.
References create_big(), create_empty(), create_small(), expect, i, LZMA_OK, my_allocator, NULL, test_cat(), test_copy(), test_corrupt(), test_equal(), test_locate(), test_many(), and test_overflow().
Definition at line 635 of file test_index.c.
|
static |
Definition at line 291 of file test_index.c.
References a, b, BIG_COUNT, c, create_big(), create_empty(), create_small(), expect, i, LZMA_INDEX_ITER_BLOCK, LZMA_OK, LZMA_STREAM_HEADER_SIZE, NULL, r, and SMALL_COUNT.
Referenced by main().
|
static |
Definition at line 212 of file test_index.c.
References coder_loop(), d, decoder_loop(), expect, free(), h, i, index_size(), is_equal(), LZMA_BUF_ERROR, LZMA_DATA_ERROR, LZMA_INDEX_ITER_BLOCK, LZMA_OK, LZMA_RUN, LZMA_STREAM_END, LZMA_STREAM_INIT, malloc(), memlimit, MEMLIMIT, NULL, pos, r, strm, and succeed.
Referenced by test_many().
|
static |
|
static |
Definition at line 593 of file test_index.c.
References coder_loop(), create_empty(), create_small(), decoder_loop_ret(), expect, free(), i, LZMA_DATA_ERROR, LZMA_OK, LZMA_PROG_ERROR, LZMA_RUN, LZMA_STREAM_END, LZMA_STREAM_INIT, malloc(), MEMLIMIT, NULL, strm, and succeed.
Referenced by main().
|
static |
Definition at line 127 of file test_index.c.
References a, b, c, create_big(), create_empty(), create_small(), expect, is_equal(), and NULL.
Referenced by main().
|
static |
Definition at line 418 of file test_index.c.
References expect, i, LZMA_INDEX_ITER_BLOCK, LZMA_OK, LZMA_STREAM_HEADER_SIZE, n, NULL, r, and start.
Referenced by main().
|
static |
Definition at line 282 of file test_index.c.
References i, test_code(), test_copy(), and test_read().
Referenced by main().
|
static |
Definition at line 149 of file test_index.c.
References create_empty(), expect, i, LZMA_DATA_ERROR, LZMA_VLI_MAX, and NULL.
Referenced by main().
|
static |
Definition at line 174 of file test_index.c.
References count, expect, i, LZMA_INDEX_ITER_BLOCK, LZMA_STREAM_HEADER_SIZE, r, stream_offset(), and uncompressed_size.
Referenced by test_many().
|
static |
Definition at line 646 of file test_index.c.
Referenced by main().