diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2016-12-27 18:25:47 +0100 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2016-12-27 18:25:47 +0100 |
commit | 3a2bbdb05ca6a6996e424c9fb225cb0d53804125 (patch) | |
tree | f29063da5bec4caf3853d49a22a09c8619eebd21 /tests/unit_tests/openvpn/mock_msg.c | |
parent | d53dba59e78da865c4fe820386ff2f4f76925f3b (diff) |
New upstream version 2.4.0upstream/2.4.0
Diffstat (limited to 'tests/unit_tests/openvpn/mock_msg.c')
-rw-r--r-- | tests/unit_tests/openvpn/mock_msg.c | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/tests/unit_tests/openvpn/mock_msg.c b/tests/unit_tests/openvpn/mock_msg.c index 54b6017..eb0d5e9 100644 --- a/tests/unit_tests/openvpn/mock_msg.c +++ b/tests/unit_tests/openvpn/mock_msg.c @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2016 Fox Crypto B.V. <openvpn@fox-it.com> + * Copyright (C) 2016-2017 Fox Crypto B.V. <openvpn@fox-it.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -39,39 +39,46 @@ unsigned int x_debug_level = 0; /* Default to (almost) no debugging output */ bool fatal_error_triggered = false; -void mock_set_debug_level(int level) +void +mock_set_debug_level(int level) { - x_debug_level = level; + x_debug_level = level; } -void x_msg_va (const unsigned int flags, const char *format, - va_list arglist) +void +x_msg_va(const unsigned int flags, const char *format, + va_list arglist) { - if (flags & M_FATAL) + if (flags & M_FATAL) { - fatal_error_triggered = true; - printf("FATAL ERROR:"); + fatal_error_triggered = true; + printf("FATAL ERROR:"); } - vprintf(format, arglist); - printf("\n"); + vprintf(format, arglist); + printf("\n"); } -void x_msg (const unsigned int flags, const char *format, ...) +void +x_msg(const unsigned int flags, const char *format, ...) { - va_list arglist; - va_start (arglist, format); - x_msg_va (flags, format, arglist); - va_end (arglist); + va_list arglist; + va_start(arglist, format); + x_msg_va(flags, format, arglist); + va_end(arglist); } void -assert_failed (const char *filename, int line, const char *condition) +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); - exit (1); + if (condition) + { + printf("Assertion failed at %s:%d (%s)", filename, line, condition); + } + else + { + printf("Assertion failed at %s:%d", filename, line); + } + exit(1); } /* @@ -79,14 +86,14 @@ assert_failed (const char *filename, int line, const char *condition) * to allocate memory as part of its operation. */ void -out_of_memory (void) +out_of_memory(void) { - fprintf (stderr, "Out of Memory\n"); - exit (1); + fprintf(stderr, "Out of Memory\n"); + exit(1); } bool -dont_mute (unsigned int flags) +dont_mute(unsigned int flags) { - return true; + return true; } |