From 977b3581fa4d2cee92d7ffb7b2e5779610bfaeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 12 Oct 2024 21:02:21 +0200 Subject: [PATCH] tests: add function record_count_messages --- tests/tests-record.cpp | 10 ++++++++++ tests/tests-record.h | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/tests-record.cpp b/tests/tests-record.cpp index 4d76fb7cb..74cf10e56 100644 --- a/tests/tests-record.cpp +++ b/tests/tests-record.cpp @@ -204,6 +204,16 @@ record_search (const char *buffer, const char *prefix, const char *message, return NULL; } +/* + * Returns the number of messages displayed during the recording. + */ + +int +record_count_messages () +{ + return arraylist_size (recorded_messages); +} + /* * Adds all recorded messages to the dynamic string "msg". */ diff --git a/tests/tests-record.h b/tests/tests-record.h index 29acaeac7..44139b95c 100644 --- a/tests/tests-record.h +++ b/tests/tests-record.h @@ -26,6 +26,7 @@ extern void record_start (); extern void record_stop (); extern struct t_hashtable *record_search (const char *buffer, const char *prefix, const char *message, const char *tags); +extern int record_count_messages (); extern void record_dump (char **msg); extern void record_error_missing (const char *message);