snapraid/raid/test.h
Andrea Mazzoleni ca459e9fb0
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Remove leading double underscores from header include guards
2026-10-13 11:20:19 +02:00

83 lines
1.8 KiB
C

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (C) 2013 Andrea Mazzoleni
#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.
*
* Tests raid_sort() with all the possible combinations of elements to sort.
*
* Returns 0 on success.
*/
int raid_test_sort(void);
/**
* Tests combination functions.
*
* Tests combination_first() and combination_next() for all the parity levels.
*
* Returns 0 on success.
*/
int raid_test_combo(void);
/**
* Tests all RAID affine GFNI matrices against scalar GF multiplication.
*
* Returns 0 on success.
*/
int raid_test_gfaffine(void);
/**
* Tests the Galois field and Cauchy matrix properties.
*
* Verifies the expected polynomial and primitive generator and basic
* properties of the Extended Cauchy matrix for the specified RAID mode.
*
* Returns 0 on success.
*/
int raid_test_poly(unsigned mode);
/**
* 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 recovering functions on the tail data disks.
*
* All the recovering functions are tested by recovering the last 1, 2, ..., np
* data disks for each disk count from 1 to nd.
*
* Returns 0 on success.
*/
int raid_test_tail(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