utils: Introduce OSMO_ASSERT in the utils and use it in the unit tests
The tests should unconditionally assert, regardless of debug settings.
This uses the OSMO_ prefix as it's in the global namespace.
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 03861d7..8f7bee3 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -51,6 +51,13 @@
rem -= ret; \
} while (0)
+#define OSMO_ASSERT(exp) \
+ if (!(exp)) { \
+ printf("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
+ abort(); \
+ }
+
+
/*! @} */
#endif