snapraid/raid/test.h

58 lines
1.2 KiB
C
Raw Permalink Normal View History

// SPDX-License-Identifier: GPL-2.0-or-later
2026-04-02 16:25:49 +02:00
// Copyright (C) 2013 Andrea Mazzoleni
2013-12-29 22:13:08 +01:00
#ifndef __RAID_TEST_H
#define __RAID_TEST_H
/**
* Tests insertion function.
*
* Tests raid_insert() with all the possible combinations of elements to insert.
*
* Returns 0 on success.
*/
int raid_test_insert(void);
/**
* Tests sorting function.
2013-12-29 22:13:08 +01:00
*
* Tests raid_sort() with all the possible combinations of elements to sort.
2013-12-29 22:13:08 +01:00
*
* Returns 0 on success.
*/
int raid_test_sort(void);
/**
2013-12-30 21:12:29 +01:00
* Tests combination functions.
2013-12-29 22:13:08 +01:00
*
* Tests combination_first() and combination_next() for all the parity levels.
*
* Returns 0 on success.
*/
int raid_test_combo(void);
/**
* Tests recovering functions.
*
* All the recovering functions are tested with all the combinations
* of failing disks and recovering parities.
*
* Take care that the test time grows exponentially with the number of disks.
*
* Returns 0 on success.
*/
int raid_test_rec(unsigned mode, int nd, size_t size);
/**
* Tests parity generation functions.
*
* All the parity generation functions are tested with the specified
* number of disks.
*
* Returns 0 on success.
*/
int raid_test_par(unsigned mode, int nd, size_t size);
#endif