summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-12-01 02:00:54 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-12-07 18:59:42 +0200
commit030fe617ef2a7064f45d5af515cd49b0a085c711 (patch)
treece9fb8968707a2bf0bce8aadf032dfff6d44d2f9
parent9ba0c3fef81dd952dcc3913f82a98b961a81d643 (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--test/log/log_process.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}