diff options
author | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-22 18:25:30 -0700 |
---|---|---|
committer | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-22 18:25:30 -0700 |
commit | 5b393fab81a3326553827ab7b1cda0ca008468a0 (patch) | |
tree | 5a86a722f8964ca9f5c1da11d851f51b2c76fc1a /test | |
parent | e96f00ee117b936bd54ed04494122eca575ca066 (diff) | |
download | liberasurecode-5b393fab81a3326553827ab7b1cda0ca008468a0.tar.gz |
algsig: Move jerasure backend dlopen up a level
.. also check for errors
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/liberasurecode_test.c | 5 | ||||
-rw-r--r-- | test/utils/chksum/test_alg_sig.c | 20 |
3 files changed, 20 insertions, 7 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 6003bbc..5f9db05 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -11,7 +11,7 @@ check_PROGRAMS = test_xor_hd_code alg_sig_test_SOURCES = utils/chksum/test_alg_sig.c alg_sig_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/erasurecode -I$(top_srcdir)/include/xor_codes alg_sig_test_LDFLAGS = -static-libtool-libs $(top_srcdir)/src/liberasurecode.la -ldl -# check_PROGRAMS += alg_sig_test +check_PROGRAMS += alg_sig_test liberasurecode_test_SOURCES = liberasurecode_test.c liberasurecode_test_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/erasurecode diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c index 670e296..7de3956 100644 --- a/test/liberasurecode_test.c +++ b/test/liberasurecode_test.c @@ -159,8 +159,9 @@ int main(int argc, char **argv) for (ii = 0; testcases[ii].description != NULL; ++ii) { fflush(stdout); if (testcases[ii].skip) { - fprintf(stdout, "ok # SKIP %d - %s\n", ii + 1, - testcases[ii].description); + fprintf(stdout, "ok # SKIP %d - %s: %s\n", ii + 1, + testcases[ii].description, + (const char *) testcases[ii].arg1); continue; } testcases[ii].function(testcases[ii].arg1, testcases[ii].arg2); diff --git a/test/utils/chksum/test_alg_sig.c b/test/utils/chksum/test_alg_sig.c index dfa1005..a0ddf4b 100644 --- a/test/utils/chksum/test_alg_sig.c +++ b/test/utils/chksum/test_alg_sig.c @@ -83,7 +83,6 @@ out: static int basic_xor_test_8_32() { - alg_sig_t* sig_handle = init_alg_sig(32, 8); int blocksize = 65536; int num_data = 12; char **data; @@ -92,6 +91,10 @@ static int basic_xor_test_8_32() int i; int ret = 0; + alg_sig_t* sig_handle = init_alg_sig(32, 8); + if (NULL == sig_handle) { + goto out; + } data = (char**)malloc(sizeof(char*) * num_data); sigs = (char**)malloc(sizeof(char*) * (num_data + 1)); for (i=0; i < num_data; i++) { @@ -125,12 +128,12 @@ static int basic_xor_test_8_32() free(data); destroy_alg_sig(sig_handle); +out: return ret; } static int basic_xor_test_16_64() { - alg_sig_t* sig_handle = init_alg_sig(64, 16); int blocksize = 65536; int num_data = 12; char **data; @@ -139,6 +142,11 @@ static int basic_xor_test_16_64() int i; int ret = 0; + alg_sig_t* sig_handle = init_alg_sig(64, 16); + if (NULL == sig_handle) { + goto out; + } + data = (char**)malloc(sizeof(char*) * num_data); sigs = (char**)malloc(sizeof(char*) * (num_data + 1)); for (i=0; i < num_data; i++) { @@ -171,13 +179,12 @@ static int basic_xor_test_16_64() free(data); destroy_alg_sig(sig_handle); +out: return ret; - } static int basic_xor_test_16_32() { - alg_sig_t* sig_handle = init_alg_sig(32, 16); int blocksize = 65536; int num_data = 12; char **data; @@ -186,6 +193,10 @@ static int basic_xor_test_16_32() int i; int ret = 0; + alg_sig_t* sig_handle = init_alg_sig(32, 16); + if (NULL == sig_handle) { + goto out; + } data = (char**)malloc(sizeof(char*) * num_data); sigs = (char**)malloc(sizeof(char*) * (num_data + 1)); for (i=0; i < num_data; i++) { @@ -219,6 +230,7 @@ static int basic_xor_test_16_32() free(data); destroy_alg_sig(sig_handle); +out: return ret; } |