summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Lambert <eric_lambert@xyratex.com>2014-08-01 11:01:36 -0700
committerEric Lambert <eric_lambert@xyratex.com>2014-08-01 11:01:36 -0700
commit584b54f0ae54bcfb894d46d6f42bce6f0af4cc32 (patch)
tree5460ff114bbfd21b95a709161d5e76ce69acbd16
parentcc765ef92a418575693b8b9017ed63935d8d815b (diff)
downloadliberasurecode-584b54f0ae54bcfb894d46d6f42bce6f0af4cc32.tar.gz
Updated test_decode_with_missing_data testcase so that it verifies
decode works regardless of which single data fragment is missing (initially the test only tested frag 0 missing).
-rw-r--r--test/liberasurecode_test.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
index 19aedb4..8611983 100644
--- a/test/liberasurecode_test.c
+++ b/test/liberasurecode_test.c
@@ -190,12 +190,24 @@ out:
static int test_decode_with_missing_data(const char *backend,
struct ec_args *args)
{
- int *skip = create_skips_array(args,0);
+ int rc = -1;
+ int i;
+ int *skip = create_skips_array(args, -1);
if (skip == NULL)
{
return -ENOMEM;
}
- int rc = encode_decode_test_impl(backend, args, skip);
+ for (i = 0; i < args->k; i++) {
+ skip[i] = 1;
+ rc = encode_decode_test_impl(backend, args, skip);
+ if (rc != 0)
+ {
+ goto out;
+ }
+ skip[i] = 0;
+ }
+ rc = 0;
+out:
free(skip);
return rc;
}