From d1e7ccec24ef9d43a0310d1410608f7dda7b63f2 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Wed, 16 Nov 2022 16:58:41 -0500 Subject: [PATCH] tests: posix: common: remove duplicate call to pthread_attr_init There was a second call to `pthread_attr_init()` that reallly had no sense being there. Also, it seems that there was a call to `pthread_attr_destroy()` out of perhaps paranoia. The duplicate call and `pthread_attr_destroy()` can be removed. Signed-off-by: Chris Friedt --- tests/posix/common/src/mqueue.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/posix/common/src/mqueue.c b/tests/posix/common/src/mqueue.c index 5753a446c25..46c846d38da 100644 --- a/tests/posix/common/src/mqueue.c +++ b/tests/posix/common/src/mqueue.c @@ -76,11 +76,7 @@ ZTEST(posix_apis, test_posix_mqueue) for (i = 0; i < N_THR; i++) { /* Creating threads */ - if (pthread_attr_init(&attr[i]) != 0) { - zassert_equal(pthread_attr_destroy(&attr[i]), 0); - zassert_false(pthread_attr_init(&attr[i]), - "pthread attr init failed"); - } + zassert_ok(pthread_attr_init(&attr[i])); pthread_attr_setstack(&attr[i], &stacks[i][0], STACKSZ); if (i % 2) {