unit-tests: Add support for more than one warning per test case

Warnings are usually short (as compared to failures that contain data
dumps), so the buffer size can be reduced.
This commit is contained in:
Tobias Brunner
2022-04-14 19:05:44 +02:00
parent a8bab0ee15
commit 7d99b29b99
3 changed files with 74 additions and 26 deletions
+12
View File
@@ -219,6 +219,18 @@ void test_setup_timeout(int s);
*/
int test_failure_get(char *msg, int len, const char **file);
/**
* Get info about warnings if any were issued during the test. Resets the
* warning state.
*
* @param cb callback that receives a custom context object, message,
* source file and line of each warning
* @param ctx context object
* @return TRUE if any warnings were issued
*/
bool test_warnings_get(void (*cb)(void *ctx, const char *msg, const char *file,
const int line), void *ctx);
/**
* Get info about a warning if one was issued during the test. Resets the
* warning state.