summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-03-10 09:05:21 -0500
committerAdam Jackson <ajax@redhat.com>2016-03-14 15:34:18 -0400
commit7d98e87af887faed21ab69f80cb0212e732ede2c (patch)
treec0a7680665af17c624ca87652be9c3e877ead559
parent5f11a5860668b1384657aca51c750520594e333e (diff)
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@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--tests.c16
1 files changed, 9 insertions, 7 deletions
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++;