From 8967823efc6f0617ad4d5666bad262a77a8f0039 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 4 Jan 2025 12:33:16 -0800 Subject: tests: make NUTS_PASS use TEST_ASSERT This will ensure that we fast fail if a test cannot complete, rather than muddling on and reporting failures elsewhere. --- src/testing/nuts.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/testing/nuts.h b/src/testing/nuts.h index 50664211..ac502ff8 100644 --- a/src/testing/nuts.h +++ b/src/testing/nuts.h @@ -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. -- cgit v1.2.3-70-g09d2