From f033b6c2c696860cf9f4726c9724701ca670bca4 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Jun 2023 01:09:52 +0200 Subject: [PATCH] testsuite: Don't always loop in memorytexture tests When running the tests, only run the random (and potentially large) size download test once instead of 10 times. There's no real benefit in doing that, both because it's unlikely to fail only in the 2nd or 9th run and because the sizes are picked randomly. This also speeds up the test massively as the download test was dominating the runtime. --- testsuite/gdk/memorytexture.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c index 138eb6844b..d0004003ec 100644 --- a/testsuite/gdk/memorytexture.c +++ b/testsuite/gdk/memorytexture.c @@ -1144,7 +1144,8 @@ should_skip_download_test (GdkMemoryFormat format, static void test_download (gconstpointer data, unsigned int width, - unsigned int height) + unsigned int height, + gsize n_runs) { GdkMemoryFormat format; TextureMethod method; @@ -1157,7 +1158,7 @@ test_download (gconstpointer data, if (should_skip_download_test (format, method)) return; - for (i = 0; i < N; i++) + for (i = 0; i < n_runs; i++) { GdkRGBA color; @@ -1184,7 +1185,7 @@ test_download (gconstpointer data, static void test_download_1x1 (gconstpointer data) { - test_download (data, 1, 1); + test_download (data, 1, 1, N); } static void @@ -1203,7 +1204,7 @@ test_download_random (gconstpointer data) } while (width * height >= 1024 * 1024); - test_download (data, width, height); + test_download (data, width, height, 1); } static void -- 2.30.2