|
|
|
|
@@ -45,11 +45,15 @@
|
|
|
|
|
#define RS_VAND_BACKEND "liberasurecode_rs_vand"
|
|
|
|
|
#define LIBPHAZR_BACKEND "libphazr"
|
|
|
|
|
|
|
|
|
|
typedef void (*TEST_FUNC)();
|
|
|
|
|
typedef void (*TEST_FUNC_NO_ARGS)(void);
|
|
|
|
|
typedef void (*TEST_FUNC_WITH_ARGS)(const ec_backend_id_t, struct ec_args *);
|
|
|
|
|
|
|
|
|
|
struct testcase {
|
|
|
|
|
const char *description;
|
|
|
|
|
TEST_FUNC function;
|
|
|
|
|
union{
|
|
|
|
|
TEST_FUNC_NO_ARGS no_args;
|
|
|
|
|
TEST_FUNC_WITH_ARGS with_args;
|
|
|
|
|
} function;
|
|
|
|
|
ec_backend_id_t be_id;
|
|
|
|
|
ec_checksum_type_t ct;
|
|
|
|
|
bool skip;
|
|
|
|
|
@@ -242,7 +246,7 @@ struct ec_args **all_backend_tests[] = {
|
|
|
|
|
libphazr_test_args,
|
|
|
|
|
NULL};
|
|
|
|
|
|
|
|
|
|
int num_backends()
|
|
|
|
|
int num_backends(void)
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
@@ -253,7 +257,7 @@ int num_backends()
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int max_tests_for_backends()
|
|
|
|
|
int max_tests_for_backends(void)
|
|
|
|
|
{
|
|
|
|
|
int n_backends = num_backends();
|
|
|
|
|
int i = 0;
|
|
|
|
|
@@ -510,18 +514,18 @@ static void test_create_and_destroy_backend(
|
|
|
|
|
assert(0 == liberasurecode_instance_destroy(desc));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_backend_available(ec_backend_id_t be_id) {
|
|
|
|
|
assert(1 == liberasurecode_backend_available(be_id));
|
|
|
|
|
static void test_backend_available(void) {
|
|
|
|
|
assert(1 == liberasurecode_backend_available(EC_BACKEND_NULL));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_backend_available_invalid_args()
|
|
|
|
|
static void test_backend_available_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int ret = liberasurecode_backend_available(EC_BACKENDS_MAX);
|
|
|
|
|
// returns 1 if a backend is available; 0 otherwise
|
|
|
|
|
assert(0 == ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_create_backend_invalid_args()
|
|
|
|
|
static void test_create_backend_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int desc = liberasurecode_instance_create(-1, &null_args);
|
|
|
|
|
assert(-EBACKENDNOTSUPP == desc);
|
|
|
|
|
@@ -550,7 +554,7 @@ static void test_create_backend_invalid_args()
|
|
|
|
|
assert(-EINVALIDPARAMS == desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_destroy_backend_invalid_args()
|
|
|
|
|
static void test_destroy_backend_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int desc = -1;
|
|
|
|
|
assert(liberasurecode_instance_destroy(desc) < 0);
|
|
|
|
|
@@ -566,7 +570,7 @@ static void test_destroy_backend_invalid_args()
|
|
|
|
|
assert(liberasurecode_instance_destroy(desc) < 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_encode_invalid_args()
|
|
|
|
|
static void test_encode_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = 0;
|
|
|
|
|
int desc = -1;
|
|
|
|
|
@@ -617,7 +621,7 @@ static void test_encode_invalid_args()
|
|
|
|
|
free(orig_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_encode_cleanup_invalid_args()
|
|
|
|
|
static void test_encode_cleanup_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = 0;
|
|
|
|
|
int desc = -1;
|
|
|
|
|
@@ -649,7 +653,7 @@ static void test_encode_cleanup_invalid_args()
|
|
|
|
|
free(orig_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_decode_invalid_args()
|
|
|
|
|
static void test_decode_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = 0;
|
|
|
|
|
int desc = -1;
|
|
|
|
|
@@ -747,7 +751,7 @@ static void test_decode_invalid_args()
|
|
|
|
|
free(orig_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_decode_cleanup_invalid_args()
|
|
|
|
|
static void test_decode_cleanup_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = 0;
|
|
|
|
|
int desc = 1;
|
|
|
|
|
@@ -769,7 +773,7 @@ static void test_decode_cleanup_invalid_args()
|
|
|
|
|
free(orig_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_reconstruct_fragment_invalid_args()
|
|
|
|
|
static void test_reconstruct_fragment_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = -1;
|
|
|
|
|
int desc = 1;
|
|
|
|
|
@@ -821,7 +825,7 @@ static void test_reconstruct_fragment_invalid_args()
|
|
|
|
|
liberasurecode_instance_destroy(desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_fragments_needed_invalid_args()
|
|
|
|
|
static void test_fragments_needed_invalid_args(void)
|
|
|
|
|
{
|
|
|
|
|
int rc = -1;
|
|
|
|
|
int desc = 1;
|
|
|
|
|
@@ -850,7 +854,7 @@ static void test_fragments_needed_invalid_args()
|
|
|
|
|
liberasurecode_instance_destroy(desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_get_fragment_metadata_invalid_args() {
|
|
|
|
|
static void test_get_fragment_metadata_invalid_args(void) {
|
|
|
|
|
int rc = -1;
|
|
|
|
|
char *frag = malloc(1024);
|
|
|
|
|
fragment_metadata_t metadata;
|
|
|
|
|
@@ -874,7 +878,7 @@ static void test_get_fragment_metadata_invalid_args() {
|
|
|
|
|
free(frag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_verify_stripe_metadata_invalid_args() {
|
|
|
|
|
static void test_verify_stripe_metadata_invalid_args(void) {
|
|
|
|
|
int rc = -1;
|
|
|
|
|
int num_frags = 6;
|
|
|
|
|
int desc = -1;
|
|
|
|
|
@@ -902,7 +906,7 @@ static void test_verify_stripe_metadata_invalid_args() {
|
|
|
|
|
free(frags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_get_fragment_partition()
|
|
|
|
|
static void test_get_fragment_partition(void)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int rc = 0;
|
|
|
|
|
@@ -1002,7 +1006,7 @@ static void test_get_fragment_partition()
|
|
|
|
|
free(orig_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_liberasurecode_get_version(){
|
|
|
|
|
static void test_liberasurecode_get_version(void){
|
|
|
|
|
uint32_t version = liberasurecode_get_version();
|
|
|
|
|
assert(version == LIBERASURECODE_VERSION);
|
|
|
|
|
}
|
|
|
|
|
@@ -1462,7 +1466,7 @@ static void test_decode_with_missing_multi_data_parity(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_isa_l_rs_vand_decode_reconstruct_specific_error_case()
|
|
|
|
|
static void test_isa_l_rs_vand_decode_reconstruct_specific_error_case(void)
|
|
|
|
|
{
|
|
|
|
|
struct ec_args specific_1010_args = {
|
|
|
|
|
.k = 10,
|
|
|
|
|
@@ -1556,7 +1560,7 @@ static void test_isa_l_rs_vand_decode_reconstruct_specific_error_case()
|
|
|
|
|
free(skips);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_jerasure_rs_cauchy_init_failure()
|
|
|
|
|
static void test_jerasure_rs_cauchy_init_failure(void)
|
|
|
|
|
{
|
|
|
|
|
struct ec_args bad_args = {
|
|
|
|
|
.k = 10,
|
|
|
|
|
@@ -1575,7 +1579,7 @@ static void test_jerasure_rs_cauchy_init_failure()
|
|
|
|
|
assert(-EBACKENDINITERR == desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_flat_xor_hd3_init_failure()
|
|
|
|
|
static void test_flat_xor_hd3_init_failure(void)
|
|
|
|
|
{
|
|
|
|
|
struct ec_args bad_args[] = {
|
|
|
|
|
{.k = 1, .m = 5, .hd=3},
|
|
|
|
|
@@ -1606,7 +1610,7 @@ static void test_simple_encode_decode(const ec_backend_id_t be_id,
|
|
|
|
|
free(skip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_jerasure_rs_vand_simple_encode_decode_over32()
|
|
|
|
|
static void test_jerasure_rs_vand_simple_encode_decode_over32(void)
|
|
|
|
|
{
|
|
|
|
|
struct ec_args over32_args = {
|
|
|
|
|
.k = 30,
|
|
|
|
|
@@ -1801,7 +1805,7 @@ static void test_verify_stripe_metadata_frag_idx_invalid(
|
|
|
|
|
verify_fragment_metadata_mismatch_impl(be_id, args, FRAGIDX_OUT_OF_RANGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_metadata_crcs_le()
|
|
|
|
|
static void test_metadata_crcs_le(void)
|
|
|
|
|
{
|
|
|
|
|
// We've observed headers like this in the wild, using our busted crc32
|
|
|
|
|
char orig_header[] =
|
|
|
|
|
@@ -1840,7 +1844,7 @@ static void test_metadata_crcs_le()
|
|
|
|
|
assert(is_invalid_fragment_header((fragment_header_t *) header) == 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_metadata_crcs_be()
|
|
|
|
|
static void test_metadata_crcs_be(void)
|
|
|
|
|
{
|
|
|
|
|
// Like above, but big-endian
|
|
|
|
|
char orig_header[] =
|
|
|
|
|
@@ -1886,60 +1890,60 @@ static void test_metadata_crcs_be()
|
|
|
|
|
#define TEST(test, backend, checksum) {#test, test, backend, checksum, .skip = false}
|
|
|
|
|
/* Block of common tests for the "real" backends */
|
|
|
|
|
#define TEST_SUITE(backend) \
|
|
|
|
|
TEST(test_create_and_destroy_backend, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_simple_encode_decode, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_decode_with_missing_data, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_decode_with_missing_parity, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_decode_with_missing_multi_data, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_decode_with_missing_multi_parity, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_decode_with_missing_multi_data_parity, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_simple_reconstruct, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_fragments_needed, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_get_fragment_metadata, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST(test_get_fragment_metadata, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_write_legacy_fragment_metadata, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata_libec_mismatch, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata_magic_mismatch, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata_be_id_mismatch, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata_be_ver_mismatch, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST(test_verify_stripe_metadata_frag_idx_invalid, backend, CHKSUM_CRC32)
|
|
|
|
|
TEST({.with_args = test_create_and_destroy_backend}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_simple_encode_decode}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_data}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_parity}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_multi_data}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_multi_parity}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_multi_data_parity}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_simple_reconstruct}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_fragments_needed}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_get_fragment_metadata}, backend, CHKSUM_NONE), \
|
|
|
|
|
TEST({.with_args = test_get_fragment_metadata}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_write_legacy_fragment_metadata}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata_libec_mismatch}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata_magic_mismatch}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata_be_id_mismatch}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata_be_ver_mismatch}, backend, CHKSUM_CRC32), \
|
|
|
|
|
TEST({.with_args = test_verify_stripe_metadata_frag_idx_invalid}, backend, CHKSUM_CRC32)
|
|
|
|
|
|
|
|
|
|
struct testcase testcases[] = {
|
|
|
|
|
TEST(test_backend_available_invalid_args, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST(test_backend_available, EC_BACKEND_NULL, 0),
|
|
|
|
|
TEST(test_create_backend_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_destroy_backend_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_encode_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_encode_cleanup_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_decode_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_decode_cleanup_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_reconstruct_fragment_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_get_fragment_metadata_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_verify_stripe_metadata_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_fragments_needed_invalid_args, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_get_fragment_partition, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_liberasurecode_get_version, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST(test_metadata_crcs_le, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST(test_metadata_crcs_be, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_backend_available_invalid_args}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_backend_available}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_create_backend_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_destroy_backend_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_encode_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_encode_cleanup_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_decode_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_decode_cleanup_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_reconstruct_fragment_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_get_fragment_metadata_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_verify_stripe_metadata_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_fragments_needed_invalid_args}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_get_fragment_partition}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_liberasurecode_get_version}, EC_BACKENDS_MAX, CHKSUM_TYPES_MAX),
|
|
|
|
|
TEST({.no_args = test_metadata_crcs_le}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_metadata_crcs_be}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
// NULL backend test
|
|
|
|
|
TEST(test_create_and_destroy_backend, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST(test_simple_encode_decode, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST(test_get_fragment_metadata, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST(test_decode_with_missing_parity, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST(test_decode_with_missing_multi_parity, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST({.with_args = test_create_and_destroy_backend}, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST({.with_args = test_simple_encode_decode}, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST({.with_args = test_get_fragment_metadata}, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_parity}, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
TEST({.with_args = test_decode_with_missing_multi_parity}, EC_BACKEND_NULL, CHKSUM_NONE),
|
|
|
|
|
// Flat XOR backend tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_FLAT_XOR_HD),
|
|
|
|
|
TEST(test_flat_xor_hd3_init_failure, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_flat_xor_hd3_init_failure}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
// Jerasure RS Vand backend tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_JERASURE_RS_VAND),
|
|
|
|
|
TEST(test_jerasure_rs_vand_simple_encode_decode_over32, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_jerasure_rs_vand_simple_encode_decode_over32}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
// Jerasure RS Cauchy backend tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_JERASURE_RS_CAUCHY),
|
|
|
|
|
TEST(test_jerasure_rs_cauchy_init_failure, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_jerasure_rs_cauchy_init_failure}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
// ISA-L rs_vand tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_ISA_L_RS_VAND),
|
|
|
|
|
TEST(test_isa_l_rs_vand_decode_reconstruct_specific_error_case, EC_BACKENDS_MAX, 0),
|
|
|
|
|
TEST({.no_args = test_isa_l_rs_vand_decode_reconstruct_specific_error_case}, EC_BACKENDS_MAX, 0),
|
|
|
|
|
// ISA-L rs cauchy tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_ISA_L_RS_CAUCHY),
|
|
|
|
|
// shss tests
|
|
|
|
|
@@ -1948,7 +1952,7 @@ struct testcase testcases[] = {
|
|
|
|
|
TEST_SUITE(EC_BACKEND_LIBERASURECODE_RS_VAND),
|
|
|
|
|
// libphazr backend tests
|
|
|
|
|
TEST_SUITE(EC_BACKEND_LIBPHAZR),
|
|
|
|
|
{ NULL, NULL, 0, 0, false },
|
|
|
|
|
{ NULL, {.no_args = NULL}, 0, 0, false },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
@@ -1975,7 +1979,7 @@ int main(int argc, char **argv)
|
|
|
|
|
printf("%d - %s: %s (idx=%d) ... ", num_cases,
|
|
|
|
|
testcases[ii].description,
|
|
|
|
|
(testname) ? testname : "", i);
|
|
|
|
|
testcases[ii].function();
|
|
|
|
|
testcases[ii].function.no_args();
|
|
|
|
|
printf("ok\n");
|
|
|
|
|
num_cases++;
|
|
|
|
|
continue;
|
|
|
|
|
@@ -1985,7 +1989,7 @@ int main(int argc, char **argv)
|
|
|
|
|
printf("%d - %s: %s (idx=%d) ... ", num_cases,
|
|
|
|
|
testcases[ii].description,
|
|
|
|
|
(testname) ? testname : "", i);
|
|
|
|
|
testcases[ii].function(testcases[ii].be_id, args);
|
|
|
|
|
testcases[ii].function.with_args(testcases[ii].be_id, args);
|
|
|
|
|
printf("ok\n");
|
|
|
|
|
free(args);
|
|
|
|
|
num_cases++;
|
|
|
|
|
|