summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Lambert <eric.lambert@seagate.com>2014-09-26 19:13:37 -0700
committerEric Lambert <eric.d.lambert@gmail.com>2014-09-26 19:13:37 -0700
commit3a108f751cd522fb30f348ff8968caeef7f6f9b8 (patch)
tree493ecaa2b5dc95f8cc52ab3cb2665989cf1c018e /test
parent06bb20ca1c9c7800ca3633ca1447deab68a5f0a4 (diff)
downloadliberasurecode-3a108f751cd522fb30f348ff8968caeef7f6f9b8.tar.gz
liberasurecode_backend_lookup_id now returns EC_BACKENDS_MAX, asnewapi
opposed to -1, when it can not locate the specified backend (-1 was a non-sensical return value since the function signature called for a type of ec_backend_id_t). NOTE: with this change we now successfully build and tests pass on OS X with clang.
Diffstat (limited to 'test')
-rw-r--r--test/liberasurecode_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
index 6b6bfd4..e81c111 100644
--- a/test/liberasurecode_test.c
+++ b/test/liberasurecode_test.c
@@ -907,10 +907,10 @@ static void test_backend_lookup_by_id()
int i =0, num_backends;
const char **supported_ec_backends =
liberasurecode_supported_backends(&num_backends);
- assert(liberasurecode_backend_lookup_id(null_name) == -1);
- assert(liberasurecode_backend_lookup_id(empty_name) == -1);
- assert(liberasurecode_backend_lookup_id(white_space_name) == -1);
- assert(liberasurecode_backend_lookup_id(missing_name) == -1);
+ assert(liberasurecode_backend_lookup_id(null_name) == EC_BACKENDS_MAX);
+ assert(liberasurecode_backend_lookup_id(empty_name) == EC_BACKENDS_MAX);
+ assert(liberasurecode_backend_lookup_id(white_space_name) == EC_BACKENDS_MAX);
+ assert(liberasurecode_backend_lookup_id(missing_name) == EC_BACKENDS_MAX);
for (i = 0; i < num_backends; i++) {
assert(liberasurecode_backend_lookup_id(supported_ec_backends[i]) == i);
}