rendercheck: 4 commits - main.c tests.c t_gtk_argb_xbgr.c t_libreoffice_xrgb.c t_triangles.c

Adam Jackson ajax at kemper.freedesktop.org
Mon Mar 14 19:34:33 UTC 2016


 main.c               |   16 +++++++++++-----
 t_gtk_argb_xbgr.c    |    6 ++++++
 t_libreoffice_xrgb.c |    1 +
 t_triangles.c        |    6 ++++++
 tests.c              |   40 ++++++++++++++++++++++++++++++----------
 5 files changed, 54 insertions(+), 15 deletions(-)

New commits:
commit 44032a7e7e25329989bbda1c715568107a6479c6
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 9 16:03:42 2016 -0500

    Enable a few more formats
    
    On a standard Xvfb configuration, this means a4, and both rgb orders of
    each of a4r4g4b4 and x4r4g4b4.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/tests.c b/tests.c
index 9c8adaf..22cbfd4 100644
--- a/tests.c
+++ b/tests.c
@@ -271,8 +271,8 @@ create_formats_list(Display *dpy)
 	/* Our testing code isn't all that hot, so don't bother trying at
 	 * the low depths yet.
 	 */
-	if ((redbits >= 1 && redbits <= 4) ||
-	    (alphabits >= 1 && alphabits <= 4))
+	if ((redbits >= 1 && redbits < 4) ||
+	    (alphabits >= 1 && alphabits < 4))
 	{
 	    continue;
 	}
commit 7d98e87af887faed21ab69f80cb0212e732ede2c
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Mar 10 09:05:21 2016 -0500

    Don't fail to find the a8r8g8b8 format pointlessly
    
    Without this, trying to test eg. just r5g6b5 would fail, because we'd
    ignore anything we didn't whitelist.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/tests.c b/tests.c
index cca96b4..9c8adaf 100644
--- a/tests.c
+++ b/tests.c
@@ -279,6 +279,11 @@ create_formats_list(Display *dpy)
 
 	describe_format(&formats[nformats].name, NULL, format);
 
+	if (format == XRenderFindStandardFormat(dpy, PictStandardARGB32))
+	{
+	    argb32index = nformats;
+	}
+
 	if (format_whitelist_len != 0) {
 	    bool ok = false;
 	    int j;
@@ -292,17 +297,14 @@ create_formats_list(Display *dpy)
 	    if (!ok) {
 		printf("Ignoring server-supported format: %s\n",
 		       formats[nformats].name);
-		free(formats[nformats].name);
-		formats[nformats].name = NULL;
+		if (nformats != argb32index) {
+		    free(formats[nformats].name);
+		    formats[nformats].name = NULL;
+		}
 		continue;
 	    }
 	}
 
-	if (format == XRenderFindStandardFormat(dpy, PictStandardARGB32))
-	{
-	    argb32index = nformats;
-	}
-
 	printf("Found server-supported format: %s\n", formats[nformats].name);
 
 	nformats++;
commit 5f11a5860668b1384657aca51c750520594e333e
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Mar 10 09:29:19 2016 -0500

    Be valgrind-clean
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/main.c b/main.c
index 4cec99b..0d3d146 100644
--- a/main.c
+++ b/main.c
@@ -31,7 +31,7 @@ bool is_verbose = false, minimalrendering = false;
 int enabled_tests = ~0;		/* Enable all tests by default */
 
 int format_whitelist_len = 0;
-char **format_whitelist;
+char **format_whitelist = NULL;
 
 /* Number of times to repeat operations so that pixmaps will tend to get moved
  * into offscreen memory and allow hardware acceleration.
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
 {
 	Display *dpy;
 	XEvent ev;
-	int i, o, maj, min;
+	int i, o, maj, min, ret = 1;
 	static int is_sync = false, print_version = false;
 	static int longopt_minimalrendering = 0;
 	XWindowAttributes a;
@@ -346,12 +346,18 @@ int main(int argc, char **argv)
 	while (XNextEvent(dpy, &ev) == 0) {
 		if (ev.type == Expose && !ev.xexpose.count) {
 			if (do_tests(dpy, &window))
-				exit(0);
+				ret = 0;
 			else
-				exit(1);
+				ret = 1;
+			break;
 		}
 	}
 
+	free(window.name);
+	for (i = 0; i < format_whitelist_len; i++)
+		free(format_whitelist[i]);
+	free(format_whitelist);
+
         XCloseDisplay(dpy);
-	return 0;
+	return ret;
 }
diff --git a/t_gtk_argb_xbgr.c b/t_gtk_argb_xbgr.c
index f19dfea..e95cb85 100644
--- a/t_gtk_argb_xbgr.c
+++ b/t_gtk_argb_xbgr.c
@@ -149,6 +149,12 @@ test_gtk_argb_xbgr(Display *dpy)
 		}
 	}
 
+	free(image_32->data);
+	XFree(image_32);
+	XFree(image_24->data);
+	XFree(image_24);
+	XFreeGC(dpy, gc_32);
+
 	record_result(&result, true);
 	return result;
 }
diff --git a/t_libreoffice_xrgb.c b/t_libreoffice_xrgb.c
index 1398a01..3196078 100644
--- a/t_libreoffice_xrgb.c
+++ b/t_libreoffice_xrgb.c
@@ -160,6 +160,7 @@ libreoffice_xrgb_test_one(Display *dpy, bool invert)
 		}
 	}
 	XDestroyImage(image);
+	XFreeGC(dpy, gc);
 
 	return true;
 }
diff --git a/tests.c b/tests.c
index ff2bbd8..cca96b4 100644
--- a/tests.c
+++ b/tests.c
@@ -243,7 +243,7 @@ create_formats_list(Display *dpy)
     memset(&templ, 0, sizeof(templ));
     templ.type = PictTypeDirect;
 
-    formats = malloc(sizeof(*formats) * nformats_allocated);
+    formats = calloc(sizeof(*formats), nformats_allocated);
     if (formats == NULL)
 	errx(1, "malloc error");
     nformats = 0;
@@ -745,6 +745,24 @@ do {								\
 		success_mask |= TEST_BUG7366;
 	}
 
+	for (i = 0; i < num_colors * nformats; i++) {
+	    free(pictures_1x1[i].name);
+	    free(pictures_10x10[i].name);
+	}
+	free(pictures_1x1);
+	free(pictures_10x10);
+	free(pictures_solid);
+
+	for (i = 0; i < num_dests; i++) {
+	    free(dests[i].name);
+	}
+	free(dests);
+
+	for (i = 0; i < nformats; i++) {
+	    free(formats[i].name);
+	}
+	free(formats);
+
 	free(test_ops);
 	free(test_src);
 	free(test_mask);
commit 3d7add9804c10f5c0555e4cf86dbddc11b3b1c6e
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Mar 14 14:51:47 2016 -0400

    triangles: Fix tests for conjoint and disjoint ops
    
    The expected destination color needs to vary by op in the same way as
    for the base ops. Takes us from 1170 tests passed of 1710 total to
    1710/1710 on Xvfb.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/t_triangles.c b/t_triangles.c
index 05f98d8..9fbbf1e 100644
--- a/t_triangles.c
+++ b/t_triangles.c
@@ -36,6 +36,12 @@
 static void
 get_dest_color (int op, color4d *in, color4d *out)
 {
+	if (op >= PictOpConjointMinimum && op <= PictOpConjointMaximum)
+	    op -= PictOpConjointMinimum;
+
+	if (op >= PictOpDisjointMinimum && op <= PictOpDisjointMaximum)
+	    op -= PictOpDisjointMinimum;
+
 	switch (op) {
 		case PictOpSrc:
 		case PictOpClear:


More information about the xorg-commit mailing list