More raid coverage extensions

This commit is contained in:
Andrea Mazzoleni 2015-03-18 22:55:17 +01:00
parent a60e7a9bb5
commit b0891290eb
5 changed files with 48 additions and 12 deletions

View file

@ -105,9 +105,10 @@ static __always_inline void *__align_ptr(void *ptr, uintptr_t size)
}
/*
* Includes the main interface header.
* Includes the main interface headers.
*/
#include "raid.h"
#include "helper.h"
/*
* Internal functions.

View file

@ -13,7 +13,6 @@
*/
#include "internal.h"
#include "helper.h"
#include "cpu.h"
#include "combo.h"
#include "memory.h"

View file

@ -65,11 +65,11 @@ sdecovtest:
$(MAKE) clean
$(MAKE) lcov_reset
$(MAKE) COVERAGE=1 all
$(SDE) -p4 -- ./fulltest
$(SDE) -p4p -- ./fulltest
$(SDE) -mrm -- ./fulltest
$(SDE) -nhm -- ./fulltest
$(SDE) -hsw -- ./fulltest
$(SDE) -p4 -- ./selftest
$(SDE) -p4p -- ./selftest
$(SDE) -mrm -- ./selftest
$(SDE) -nhm -- ./selftest
$(SDE) -hsw -- ./selftest

View file

@ -56,35 +56,69 @@ int main(void)
printf("\nPlease wait about 60 seconds...\n\n");
printf("Test sorting...\n");
if (raid_test_sort() != 0)
if (raid_test_sort() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test insertion...\n");
if (raid_test_insert() != 0)
if (raid_test_insert() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test combinations/permutations...\n");
if (raid_test_combo() != 0)
if (raid_test_combo() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Cauchy parity generation with %u data disks...\n", RAID_DATA_MAX);
if (raid_test_par(RAID_MODE_CAUCHY, RAID_DATA_MAX, TEST_SIZE) != 0)
if (raid_test_par(RAID_MODE_CAUCHY, RAID_DATA_MAX, TEST_SIZE) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Cauchy parity generation with 1 data disk...\n");
if (raid_test_par(RAID_MODE_CAUCHY, 1, TEST_SIZE) != 0)
if (raid_test_par(RAID_MODE_CAUCHY, 1, TEST_SIZE) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Cauchy recovering with all combinations of %u data and 6 parity blocks...\n", TEST_COUNT);
if (raid_test_rec(RAID_MODE_CAUCHY, TEST_COUNT, TEST_SIZE) != 0)
if (raid_test_rec(RAID_MODE_CAUCHY, TEST_COUNT, TEST_SIZE) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Vandermonde parity generation with %u data disks...\n", RAID_DATA_MAX);
if (raid_test_par(RAID_MODE_VANDERMONDE, RAID_DATA_MAX, TEST_SIZE) != 0)
if (raid_test_par(RAID_MODE_VANDERMONDE, RAID_DATA_MAX, TEST_SIZE) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Vandermonde recovering with all combinations of %u data and 3 parity blocks...\n", TEST_COUNT);
if (raid_test_rec(RAID_MODE_VANDERMONDE, TEST_COUNT, TEST_SIZE) != 0)
if (raid_test_rec(RAID_MODE_VANDERMONDE, TEST_COUNT, TEST_SIZE) != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("OK\n");
return 0;
bail:
/* LCOV_EXCL_START */
printf("FAILED!\n");
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}

View file

@ -28,8 +28,10 @@ int main(void)
printf("Self test...\n");
if (raid_selftest() != 0) {
/* LCOV_EXCL_START */
printf("FAILED!\n");
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}
printf("OK\n\n");