tests: pk_helpers: optimize failure reporting in mbedtls_pk_helpers_populate_context

Keep TEST_EQUAL() on the function that might fail so that if a failure
happen the message will report the actual function that failed.

Documentation of the helper function is also updated.

Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
Valerio Setti
2026-01-14 23:09:35 +01:00
parent 2d7c5cb574
commit 4eebe42a11
2 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -74,7 +74,9 @@ mbedtls_svc_key_id_t mbedtls_pk_helpers_make_psa_key_from_predefined(psa_key_typ
* \param method The desired method for populating the PK context. See
* "pk_context_populate_method_t" for available options.
*
* \return 0 on success; an error code otherwise.
* \return 0 on success.
* In case of failure -1 is returned and the test case is marked
* as failed.
*/
int mbedtls_pk_helpers_populate_context(mbedtls_pk_context *pk, mbedtls_svc_key_id_t key_id,
pk_context_populate_method_t method);