]> icculus.org git repositories - icculus/xz.git/blob - tests/test_index.c
Imported to git.
[icculus/xz.git] / tests / test_index.c
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       test_inndex.c
4 /// \brief      Tests functions handling the lzma_index structure
5 //
6 //  Copyright (C) 2007 Lasse Collin
7 //
8 //  This library is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (at your option) any later version.
12 //
13 //  This library is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 #include "tests.h"
21
22
23 int
24 main()
25 {
26         lzma_index index[3] = {
27                 { 22, 33, index + 1 },
28                 { 44, 55, index + 2 },
29                 { 66, 77, NULL },
30         };
31
32         lzma_index *i = lzma_index_dup(index, NULL);
33         expect(i != NULL);
34
35         expect(lzma_index_is_equal(index, i));
36
37         i->next->next->uncompressed_size = 99;
38         expect(!lzma_index_is_equal(index, i));
39
40         lzma_index_free(i, NULL);
41
42         return 0;
43 }