summaryrefslogtreecommitdiff
path: root/src/libstrongswan/tests/test_suite.h
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
committerYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
commit6eb3bec5bee061bbb6a5c10f01d9737fb4597265 (patch)
treec1d58904577a286f7788ab5d2a4f116b07163698 /src/libstrongswan/tests/test_suite.h
parent745cb3e75fbcd8bc70e8b5f55a91ae2c8a274688 (diff)
parente1d78dc2faaa06e7c3f71ef674a71e4de2f0758e (diff)
downloadvyos-strongswan-6eb3bec5bee061bbb6a5c10f01d9737fb4597265.tar.gz
vyos-strongswan-6eb3bec5bee061bbb6a5c10f01d9737fb4597265.zip
Update upstream source from tag 'upstream/5.6.1'
Update to upstream version '5.6.1' with Debian dir 3996fc7d7b19a96b252a7fcbac12c94452d1e7d7
Diffstat (limited to 'src/libstrongswan/tests/test_suite.h')
-rw-r--r--src/libstrongswan/tests/test_suite.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libstrongswan/tests/test_suite.h b/src/libstrongswan/tests/test_suite.h
index 97c1b42c1..9b9fcad85 100644
--- a/src/libstrongswan/tests/test_suite.h
+++ b/src/libstrongswan/tests/test_suite.h
@@ -220,6 +220,17 @@ void test_setup_timeout(int s);
int test_failure_get(char *msg, int len, const char **file);
/**
+ * Get info about a warning if one was issued during the test. Resets the
+ * warning state.
+ *
+ * @param msg buffer receiving warning
+ * @param len size of msg buffer
+ * @param file pointer receiving source code file
+ * @return source code line number, 0 if no warning issued
+ */
+int test_warning_get(char *msg, int len, const char **file);
+
+/**
* Get a backtrace for a failure.
*
* @return allocated backtrace of test failure, if any
@@ -247,6 +258,18 @@ void test_fail_vmsg(const char *file, int line, char *fmt, va_list args);
void test_fail_msg(const char *file, int line, char *fmt, ...);
/**
+ * Issue a warning for a particular test with a message using printf style
+ * arguments. This does not fail the test, and only the last warning for each
+ * test is kept.
+ *
+ * @param file source code file name
+ * @param line source code line number
+ * @param fmt printf format string
+ * @param ... arguments for fmt
+ */
+void test_warn_msg(const char *file, int line, char *fmt, ...);
+
+/**
* Let a test fail if one of the worker threads has failed (only if called from
* the main thread).
*/
@@ -345,6 +368,7 @@ void test_fail_if_worker_failed();
#define ck_assert_msg test_assert_msg
#define ck_assert_str_eq test_str_eq
#define ck_assert_chunk_eq test_chunk_eq
+#define warn(fmt, ...) test_warn_msg(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
#define fail(fmt, ...) test_fail_msg(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
#define fail_if(x, fmt, ...) \
({ \