diff --git a/src/common/test_util.h b/src/common/test_util.h
index 4a2439fe1de451150432b73ba15f2e1c1c1321ca..33007e07f4999a5b6b3aacf16a1bdca13e9eed09 100644
--- a/src/common/test_util.h
+++ b/src/common/test_util.h
@@ -165,6 +165,12 @@ void _strfail(const char *a, const char *e, int len);
     }                                                                \
   } while (0)
 
+#define CHECK_CALL(call)     \
+  do {                       \
+    const char *r = (call);  \
+    if (r != NULL) return r; \
+  } while (0)
+
 #ifndef MG_ENABLE_POLL_UNTIL
 #define MG_ENABLE_POLL_UNTIL 0
 #endif