[Concept,13/33] test: video: Restore auto-sync at end of video_sync_damage

Message ID 20260416023021.626949-14-sjg@u-boot.org
State New
Headers
Series Fix memory leaks and test pollution in sandbox tests |

Commit Message

Simon Glass April 16, 2026, 2:29 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

dm_test_video_sync_damage() sets video_set_manual_sync(true) so that its
assertions can observe the damage rectangle in isolation from automatic
syncs. The mirror test dm_test_video_manual_sync() puts the flag back to
false on exit, but this one falls out of the function with the flag
still set. Any later test that relies on video_sync() actually copying
fb to copy_fb then fails spuriously.

Reset the flag before returning, matching dm_test_video_manual_sync
so the two tests can run in any order and leave the global video
state as they found it.

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

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

Patch

diff --git a/test/dm/video.c b/test/dm/video.c
index f97e2183a64..18d257e39f4 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -1618,6 +1618,9 @@  static int dm_test_video_sync_damage(struct unit_test_state *uts)
 	/* Check priv->damage after sync - should be reset to inverted/empty */
 	ut_assert(!vid_bbox_valid(&priv->damage));
 
+	/* Restore auto-sync so later tests see the default behaviour */
+	video_set_manual_sync(false);
+
 	return 0;
 }
 DM_TEST(dm_test_video_sync_damage, UTF_SCAN_PDATA | UTF_SCAN_FDT);