]> git.sesse.net Git - bcachefs-tools-debian/blob - raid/test.h
Move c_src dirs back to toplevel
[bcachefs-tools-debian] / raid / test.h
1 /*
2  * Copyright (C) 2013 Andrea Mazzoleni
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  */
14
15 #ifndef __RAID_TEST_H
16 #define __RAID_TEST_H
17
18 /**
19  * Tests insertion function.
20  *
21  * Test raid_insert() with all the possible combinations of elements to insert.
22  *
23  * Returns 0 on success.
24  */
25 int raid_test_insert(void);
26
27 /**
28  * Tests sorting function.
29  *
30  * Test raid_sort() with all the possible combinations of elements to sort.
31  *
32  * Returns 0 on success.
33  */
34 int raid_test_sort(void);
35
36 /**
37  * Tests combination functions.
38  *
39  * Tests combination_first() and combination_next() for all the parity levels.
40  *
41  * Returns 0 on success.
42  */
43 int raid_test_combo(void);
44
45 /**
46  * Tests recovering functions.
47  *
48  * All the recovering functions are tested with all the combinations
49  * of failing disks and recovering parities.
50  *
51  * Take care that the test time grows exponentially with the number of disks.
52  *
53  * Returns 0 on success.
54  */
55 int raid_test_rec(unsigned mode, int nd, size_t size);
56
57 /**
58  * Tests parity generation functions.
59  *
60  * All the parity generation functions are tested with the specified
61  * number of disks.
62  *
63  * Returns 0 on success.
64  */
65 int raid_test_par(unsigned mode, int nd, size_t size);
66
67 #endif
68