[Concept,02/16] video: Report failure to write a frame to a file

Message ID 20251014111301.1059317-3-sjg@chromium.org
State New
Headers
Series boot: Separate out the boot-menu style |

Commit Message

Simon Glass Oct. 14, 2025, 11:12 a.m. UTC
  Rather than just printing a message (which is suppressed unless -v is
used) fail the test if it is not possible to write to the provided
directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/dm/video.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Patch

diff --git a/test/dm/video.c b/test/dm/video.c
index e51ff7789c7..616aee3f84d 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -169,9 +169,10 @@  int video_compress_fb(struct unit_test_state *uts, struct udevice *dev,
 		snprintf(filename, sizeof(filename), "%s/frame%d.bmp",
 			 state->video_frames_dir, state->video_frame_count++);
 		ret = video_write_bmp(uts, dev, filename);
-		if (ret)
-			printf("Failed to write frame to %s: %d\n", filename,
-			       ret);
+		if (ret) {
+			ut_reportf("Failed to write frame to %s: %d",
+				   filename, ret);
+		}
 	}
 
 	/* provide a useful delay if -V flag is used or LOG_DEBUG is set */