Skip to content

Commit

Permalink
tests: make NUTS_PASS use TEST_ASSERT
Browse files Browse the repository at this point in the history
This will ensure that we fast fail if a test cannot complete,
rather than muddling on and reporting failures elsewhere.
  • Loading branch information
gdamore committed Jan 4, 2025
1 parent e3f1d08 commit 8967823
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/testing/nuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ extern const char *nuts_ecdsa_client_crt;

// NUTS_SUCCESS tests for NNG success. It reports the failure if it
// did not.
#define NUTS_PASS(cond) \
do { \
int result_ = (cond); \
TEST_CHECK_(result_ == 0, "%s succeeds", #cond); \
TEST_MSG("%s: expected success, got %s (%d)", #cond, \
nng_strerror(result_), result_); \
#define NUTS_PASS(cond) \
do { \
int result_ = (cond); \
TEST_ASSERT_(result_ == 0, \
"%s: expected success, got %s (%d)", #cond, \
nng_strerror(result_), result_); \
} while (0)

// NUTS_ERROR tests for a specific NNG error code.
Expand Down

0 comments on commit 8967823

Please sign in to comment.