From ac2cd387996f63330a21e89dfd2d1aa1395748e6 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Tue, 5 Sep 2023 14:25:49 +0200 Subject: [PATCH] [review] xtest: regression: add case 1040 Addressing comments. Signed-off-by: Jens Wiklander --- host/xtest/regression_1000.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c index c550d9dbe..54f89bf0e 100644 --- a/host/xtest/regression_1000.c +++ b/host/xtest/regression_1000.c @@ -3305,11 +3305,15 @@ static void *test_1040_thread(void *arg) &err_orig); TEEC_CloseSession(&session); if (res != TEEC_ERROR_TARGET_DEAD) { - a->res = res; + if (res) + a->res = res; + else + a->res = TEEC_ERROR_GENERIC; return NULL; } n++; } + a->res = TEEC_SUCCESS; return NULL; } @@ -3323,7 +3327,7 @@ static void xtest_tee_test_1040(ADBG_Case_t *c) for (n = 0; n < nt; n++) { if (!ADBG_EXPECT(c, 0, pthread_create(&arg[n].thr, NULL, test_1040_thread, - arg + n))) + arg + n))) nt = n; /* break loop and start cleanup */ } for (n = 0; n < nt; n++) { @@ -3335,4 +3339,3 @@ static void xtest_tee_test_1040(ADBG_Case_t *c) } ADBG_CASE_DEFINE(regression, 1040, xtest_tee_test_1040, "Test panic in concurrent open/invoke/close session"); -