Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions test/wh_test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@
* Helper macro for test error propagation
* Evaluates the "call" argument, and if not equal to zero, displays the
* stringified call argument along with caller source file info and
* causes the calling function to return the value of "call"
* causes the calling function to return the value of "call".
* Use a specific variable name to not overlap with local vars (rc or ret).
*/
#define WH_TEST_RETURN_ON_FAIL(call) \
do { \
int ret = (call); \
if (ret != WH_TEST_SUCCESS && ret != WH_TEST_SKIP) { \
WH_ERROR_PRINT(#call ": ret=%d\n", ret); \
return ret; \
} \
#define WH_TEST_RETURN_ON_FAIL(call) \
do { \
int _whTestRet = (call); \
if (_whTestRet != WH_TEST_SUCCESS && _whTestRet != WH_TEST_SKIP) { \
WH_ERROR_PRINT(#call ": ret=%d\n", _whTestRet); \
return _whTestRet; \
} \
} while (0)

/* Number of cryptoCb dispatch modes the test suites exercise on the client
Expand Down
4 changes: 2 additions & 2 deletions test/wh_test_keywrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ int whTest_KeyWrapClientConfig(whClientConfig* clientCfg)
}

#ifdef WOLFHSM_CFG_ENABLE_AUTHENTICATION
/* Log in as an admin user for the rest of the tests */
/* Attempt log in as an admin user for the rest of the tests. The server
* may not support auth, so do not require the login itself to succeed. */
WH_TEST_RETURN_ON_FAIL(wh_Client_AuthLogin(
client, WH_AUTH_METHOD_PIN, TEST_ADMIN_USERNAME, TEST_ADMIN_PIN,
strlen(TEST_ADMIN_PIN), &ret, NULL));
WH_TEST_ASSERT_RETURN(ret == 0);
#endif /* WOLFHSM_CFG_ENABLE_AUTHENTICATION */

ret = whTest_Client_KeyWrap(client);
Expand Down
Loading