xtest: add test entry for transfer list#788
Conversation
|
Add macros and helper function to avoid returning error for not supported tests. |
| Do_ADBG_BeginSubCase(c, "Core transfer list self tests"); | ||
|
|
||
| (void)ADBG_EXPECT_TEEC_SUCCESS(c, TEEC_InvokeCommand( | ||
| (void)ADBG_EXPECT_TEEC_SUCCESS_OR_NOTSUPPORT(c, TEEC_InvokeCommand( |
There was a problem hiding this comment.
Please use a helper variable to store the result from TEEC_InvokeCommand() to improve the line breaks, and drop the (void).
I know the rest of this function is different, but we need to start somewhere to improve the pattern.
| #define ADBG_EXPECT_TEEC_SUCCESS(c, got) \ | ||
| ADBG_EXPECT_ENUM(c, TEEC_SUCCESS, got, ADBG_EnumTable_TEEC_Result) | ||
|
|
||
| #define ADBG_EXPECT_TEEC_SUCCESS_OR_NOTSUPPORT(c, got) \ |
There was a problem hiding this comment.
If we are to truncate NOT_SUPPORTED (which I think is a good idea), I'd rather have ADBG_EXPECT_TEEC_SUCCESS_OR_NOTSUPP. I think it reads better, and also think about EOPNOTSUPP.
There was a problem hiding this comment.
I have my doubts about the macro. Is this hard to read or write?
res = TEEC_InvokeCommand(...);
if (res == TEE_ERROR_NOT_SUPPORTED)
Do_ADBG_Log("PTA_INVOKE_TESTS_CMD_TRANSFER_LIST_TESTS not supported, skipping");
else
ADBG_EXPECT_TEEC_SUCCESS(c, res);There was a problem hiding this comment.
I'm fine with that too, it's what we have been doing for ages. With the advantage that the message can be more detailed.
There was a problem hiding this comment.
I would also be in favor of Jens' explicit implementation.
There was a problem hiding this comment.
The idea of my patch is just to respect and follow the existing pattern, if all of you agree I can change it to what @jenswi-linaro proposed.
0b1ade0 to
ca396c8
Compare
|
All comments are addressed. |
|
|
jforissier
left a comment
There was a problem hiding this comment.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
etienne-lms
left a comment
There was a problem hiding this comment.
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Add test entry for transfer list in xtest 1001. Minor improvements for the code pattern. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
ca396c8 to
ed52bec
Compare
|
Added tags and rebased. |
Add test entry for transfer list in xtest 1001.