summaryrefslogtreecommitdiff
path: root/tests/unit_tests/openvpn/mock_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/openvpn/mock_msg.c')
-rw-r--r--tests/unit_tests/openvpn/mock_msg.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/unit_tests/openvpn/mock_msg.c b/tests/unit_tests/openvpn/mock_msg.c
index eb0d5e9..060588f 100644
--- a/tests/unit_tests/openvpn/mock_msg.c
+++ b/tests/unit_tests/openvpn/mock_msg.c
@@ -29,9 +29,12 @@
#endif
#include <stdarg.h>
-#include <stdbool.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
#include "errlevel.h"
#include "error.h"
@@ -70,14 +73,8 @@ x_msg(const unsigned int flags, const char *format, ...)
void
assert_failed(const char *filename, int line, const char *condition)
{
- if (condition)
- {
- printf("Assertion failed at %s:%d (%s)", filename, line, condition);
- }
- else
- {
- printf("Assertion failed at %s:%d", filename, line);
- }
+ mock_assert(false, condition ? condition : "", filename, line);
+ /* Keep compiler happy. Should not happen, mock_assert() does not return */
exit(1);
}