From 030fe617ef2a7064f45d5af515cd49b0a085c711 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 1 Dec 2023 02:00:54 +0200 Subject: test: log: log_process: Log an error when failing due to incorrect message One of the error paths in the test returns without logging a message, which makes failures difficult to debug. Fix it by adding an error message. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- test/log/log_process.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index 966b80cf..17af7d74 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -115,8 +115,11 @@ protected: close(fd); string str(buf); - if (str.find(message) == string::npos) + if (str.find(message) == string::npos) { + cerr << "Received message is not correct (received " + << str.length() << " bytes)" << endl; return TestFail; + } return TestPass; } -- cgit v1.2.1