aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-04 12:33:16 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-04 12:53:22 -0800
commit8967823efc6f0617ad4d5666bad262a77a8f0039 (patch)
treea340e7c12c6ba4698777cade1c0821766b9d1d84
parente3f1d0805778cfb29afdae284ad9b5dbabe18579 (diff)
downloadnng-8967823efc6f0617ad4d5666bad262a77a8f0039.tar.gz
nng-8967823efc6f0617ad4d5666bad262a77a8f0039.tar.bz2
nng-8967823efc6f0617ad4d5666bad262a77a8f0039.zip
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.
-rw-r--r--src/testing/nuts.h12
1 files changed, 6 insertions, 6 deletions
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.