diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/builtin/rs_vand/liberasurecode_rs_vand_test.c (renamed from test/builtin/rs_vand/rs_vand_internal_test.c) | 14 | ||||
-rw-r--r-- | test/liberasurecode_test.c | 60 |
3 files changed, 43 insertions, 41 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index e45d400..d2449a5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = builtin/xor_codes/test_xor_hd_code.h -noinst_PROGRAMS = test_xor_hd_code alg_sig_test liberasurecode_test libec_slap rs_galois_test rs_vand_internal_test +noinst_PROGRAMS = test_xor_hd_code alg_sig_test liberasurecode_test libec_slap rs_galois_test liberasurecode_rs_vand_test test_xor_hd_code_SOURCES = \ builtin/xor_codes/test_xor_hd_code.c \ @@ -28,10 +28,10 @@ rs_galois_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_van rs_galois_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la check_PROGRAMS += rs_galois_test -rs_vand_internal_test_SOURCES = builtin/rs_vand/rs_vand_internal_test.c -rs_vand_internal_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_vand @GCOV_FLAGS@ -rs_vand_internal_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la -check_PROGRAMS += rs_vand_internal_test +liberasurecode_rs_vand_test_SOURCES = builtin/rs_vand/liberasurecode_rs_vand_test.c +liberasurecode_rs_vand_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/rs_vand @GCOV_FLAGS@ +liberasurecode_rs_vand_test_LDFLAGS = @GCOV_LDFLAGS@ -static-libtool-libs $(top_srcdir)/src/builtin/rs_vand/liberasurecode_rsvand.la +check_PROGRAMS += liberasurecode_rs_vand_test MOSTLYCLEANFILES = *.gcda *.gcno *.gcov \ ./builtin/xor_codes/*.gcda ./builtin/xor_codes/*.gcno ./builtin/xor_codes/*.gcov \ diff --git a/test/builtin/rs_vand/rs_vand_internal_test.c b/test/builtin/rs_vand/liberasurecode_rs_vand_test.c index 09fc507..ae43ad9 100644 --- a/test/builtin/rs_vand/rs_vand_internal_test.c +++ b/test/builtin/rs_vand/liberasurecode_rs_vand_test.c @@ -30,7 +30,7 @@ #include <unistd.h> #include <fcntl.h> #include <time.h> -#include <rs_vand_internal.h> +#include <liberasurecode_rs_vand.h> int test_make_systematic_matrix(int k, int m) { @@ -152,7 +152,7 @@ int test_encode_decode(int k, int m, int num_missing, int blocksize) } // Encode - internal_rs_vand_encode(matrix, data, parity, k, m, blocksize); + liberasurecode_rs_vand_encode(matrix, data, parity, k, m, blocksize); // Copy data and parity for (i = 0;i < num_missing; i++) { @@ -175,7 +175,7 @@ int test_encode_decode(int k, int m, int num_missing, int blocksize) } // Decode and check - internal_rs_vand_decode(matrix, data, parity, k, m, missing, blocksize, 1); + liberasurecode_rs_vand_decode(matrix, data, parity, k, m, missing, blocksize, 1); for (i = 0; i < num_missing; i++) { int idx = missing[i]; @@ -235,7 +235,7 @@ int test_reconstruct(int k, int m, int num_missing, int blocksize) } // Encode - internal_rs_vand_encode(matrix, data, parity, k, m, blocksize); + liberasurecode_rs_vand_encode(matrix, data, parity, k, m, blocksize); // Copy data and parity for (i = 0; i < num_missing; i++) { @@ -261,7 +261,7 @@ int test_reconstruct(int k, int m, int num_missing, int blocksize) } // Reconstruct and check destination buffer - internal_rs_vand_reconstruct(matrix, data, parity, k, m, missing, destination_idx, blocksize); + liberasurecode_rs_vand_reconstruct(matrix, data, parity, k, m, missing, destination_idx, blocksize); // The original copy of the destination buffer is in the 0th buffer (see above) if (destination_idx < k) { @@ -302,7 +302,7 @@ int main() while (matrix_dimensions[i][0] >= 0) { int k = matrix_dimensions[i][0], m = matrix_dimensions[i][1]; - init_rs_vand(k, m); + init_liberasurecode_rs_vand(k, m); int make_systematic_res = test_make_systematic_matrix(k, m); if (!make_systematic_res) { @@ -329,7 +329,7 @@ int main() } - deinit_rs_vand(k, m); + deinit_liberasurecode_rs_vand(k, m); i++; } diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c index 9f1ad9d..e4539cd 100644 --- a/test/liberasurecode_test.c +++ b/test/liberasurecode_test.c @@ -39,7 +39,7 @@ #define JERASURE_RS_CAUCHY_BACKEND "jerasure_rs_cauchy" #define ISA_L_RS_VAND_BACKEND "isa_l_rs_vand" #define SHSS_BACKEND "shss" -#define RS_VAND_BACKEND "rs_vand" +#define RS_VAND_BACKEND "liberasurecode_rs_vand" typedef void (*TEST_FUNC)(); @@ -181,7 +181,7 @@ struct ec_args shss_args = { struct ec_args *shss_test_args[] = { &shss_args, NULL }; -struct ec_args internal_rs_vand_args = { +struct ec_args liberasurecode_rs_vand_args = { .k = 10, .m = 4, .w = 16, @@ -189,7 +189,7 @@ struct ec_args internal_rs_vand_args = { .ct = CHKSUM_NONE, }; -struct ec_args internal_rs_vand_44_args = { +struct ec_args liberasurecode_rs_vand_44_args = { .k = 4, .m = 4, .w = 16, @@ -197,7 +197,7 @@ struct ec_args internal_rs_vand_44_args = { .ct = CHKSUM_NONE, }; -struct ec_args internal_rs_vand_48_args = { +struct ec_args liberasurecode_rs_vand_48_args = { .k = 4, .m = 8, .w = 16, @@ -205,7 +205,7 @@ struct ec_args internal_rs_vand_48_args = { .ct = CHKSUM_NONE, }; -struct ec_args internal_rs_vand_1010_args = { +struct ec_args liberasurecode_rs_vand_1010_args = { .k = 10, .m = 10, .w = 16, @@ -213,20 +213,22 @@ struct ec_args internal_rs_vand_1010_args = { .ct = CHKSUM_NONE, }; -struct ec_args *internal_rs_vand_test_args[] = { &internal_rs_vand_args, - &internal_rs_vand_44_args, - &internal_rs_vand_1010_args, - &internal_rs_vand_48_args, - NULL }; - -struct ec_args **all_backend_tests[] = { null_test_args, - flat_xor_test_args, - jerasure_rs_vand_test_args, - jerasure_rs_cauchy_test_args, - isa_l_test_args, - shss_test_args, - internal_rs_vand_test_args, - NULL}; +struct ec_args *liberasurecode_rs_vand_test_args[] = { + &liberasurecode_rs_vand_args, + &liberasurecode_rs_vand_44_args, + &liberasurecode_rs_vand_1010_args, + &liberasurecode_rs_vand_48_args, + NULL }; + +struct ec_args **all_backend_tests[] = { + null_test_args, + flat_xor_test_args, + jerasure_rs_vand_test_args, + jerasure_rs_cauchy_test_args, + isa_l_test_args, + shss_test_args, + liberasurecode_rs_vand_test_args, + NULL}; int num_backends() { @@ -303,7 +305,7 @@ struct ec_args *create_ec_args(ec_backend_id_t be, ec_checksum_type_t ct, int ba backend_args_array = jerasure_rs_cauchy_test_args; break; case EC_BACKEND_INTERNAL_RS_VAND: - backend_args_array = internal_rs_vand_test_args; + backend_args_array = liberasurecode_rs_vand_test_args; break; case EC_BACKEND_FLAT_XOR_HD: backend_args_array = flat_xor_test_args; @@ -1833,39 +1835,39 @@ struct testcase testcases[] = { test_create_and_destroy_backend, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"simple_encode_internal_rs_vand", + {"simple_encode_liberasurecode_rs_vand", test_simple_encode_decode, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"decode_with_missing_data_internal_rs_vand", + {"decode_with_missing_data_liberasurecode_rs_vand", test_decode_with_missing_data, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"decode_with_missing_multi_data_internal_rs_vand", + {"decode_with_missing_multi_data_liberasurecode_rs_vand", test_decode_with_missing_multi_data, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"decode_with_missing_multi_parity_internal_rs_vand", + {"decode_with_missing_multi_parity_liberasurecode_rs_vand", test_decode_with_missing_multi_parity, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"test_decode_with_missing_multi_data_parity_internal_rs_vand", + {"test_decode_with_missing_multi_data_parity_liberasurecode_rs_vand", test_decode_with_missing_multi_data_parity, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"simple_reconstruct_internal_rs_vand", + {"simple_reconstruct_liberasurecode_rs_vand", test_simple_reconstruct, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"test_fragments_needed_internal_rs_vand", + {"test_fragments_needed_liberasurecode_rs_vand", test_fragments_needed, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"test_get_fragment_metadata_internal_rs_vand", + {"test_get_fragment_metadata_liberasurecode_rs_vand", test_get_fragment_metadata, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_NONE, .skip = false}, - {"test_get_fragment_metadata_internal_rs_vand_crc32", + {"test_get_fragment_metadata_liberasurecode_rs_vand_crc32", test_get_fragment_metadata, EC_BACKEND_INTERNAL_RS_VAND, CHKSUM_CRC32, .skip = false}, |