diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-05-24 12:05:55 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-05-26 09:45:43 +0300 |
commit | f1b6c6d6878608da82659d496e4d78b5cd275b1a (patch) | |
tree | 611b6f4a5e1df2d1603d472a2161b92f69b61d01 /test/validation/api/thread | |
parent | f65eaefd7eaf6d9917d20963adb0d7832aeb2175 (diff) |
validation: use ODPH_ERR() macro for error prints
Use ODPH_ERR() macro for all error prints in the validation tests and make
error messages more consistent. The helper macro adds additional debug
information (filename, line number, function name) to the error messages,
which can help debugging.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'test/validation/api/thread')
-rw-r--r-- | test/validation/api/thread/thread.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/validation/api/thread/thread.c b/test/validation/api/thread/thread.c index 2dc799c2a..87c23e74e 100644 --- a/test/validation/api/thread/thread.c +++ b/test/validation/api/thread/thread.c @@ -30,7 +30,7 @@ static int thread_global_init(odp_instance_t *inst) odph_helper_options_t helper_options; if (odph_options(&helper_options)) { - fprintf(stderr, "error: odph_options() failed.\n"); + ODPH_ERR("odph_options() failed\n"); return -1; } @@ -38,11 +38,11 @@ static int thread_global_init(odp_instance_t *inst) init_param.mem_model = helper_options.mem_model; if (0 != odp_init_global(inst, &init_param, NULL)) { - fprintf(stderr, "error: odp_init_global() failed.\n"); + ODPH_ERR("odp_init_global() failed\n"); return -1; } if (0 != odp_init_local(*inst, ODP_THREAD_CONTROL)) { - fprintf(stderr, "error: odp_init_local() failed.\n"); + ODPH_ERR("odp_init_local() failed\n"); return -1; } @@ -50,7 +50,7 @@ static int thread_global_init(odp_instance_t *inst) sizeof(global_shared_mem_t), ODP_CACHE_LINE_SIZE, 0); if (global_shm == ODP_SHM_INVALID) { - fprintf(stderr, "Unable reserve memory for global_shm\n"); + ODPH_ERR("Unable to reserve memory for global_shm\n"); return -1; } @@ -66,17 +66,17 @@ static int thread_global_term(odp_instance_t inst) shm = odp_shm_lookup(GLOBAL_SHM_NAME); if (0 != odp_shm_free(shm)) { - fprintf(stderr, "error: odp_shm_free() failed.\n"); + ODPH_ERR("odp_shm_free() failed\n"); return -1; } if (0 != odp_term_local()) { - fprintf(stderr, "error: odp_term_local() failed.\n"); + ODPH_ERR("odp_term_local() failed\n"); return -1; } if (0 != odp_term_global(inst)) { - fprintf(stderr, "error: odp_term_global() failed.\n"); + ODPH_ERR("odp_term_global() failed\n"); return -1; } |