rendercheck: 2 commits - main.c Makefile.am rendercheck.1 rendercheck.h tests.c

Eric Anholt anholt at kemper.freedesktop.org
Thu Jun 29 20:14:34 EEST 2006


 Makefile.am   |    1 +
 main.c        |   27 ++++++++++++++++++++++++---
 rendercheck.1 |    9 +++++++--
 rendercheck.h |    5 +++++
 tests.c       |   28 ++++++++++++++++++++++++++++
 5 files changed, 65 insertions(+), 5 deletions(-)

New commits:
diff-tree a3c9527030127fe6dd06d1d75207b4e855b93db8 (from 388f4492b3099546a2af89e59bc8807709508b53)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Thu Jun 29 19:12:52 2006 +0200

    Add a regression test for bug #7366 (crash on transform of source picture).

diff --git a/Makefile.am b/Makefile.am
index e2ad1c3..03b1e1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,7 @@ rendercheck_SOURCES = \
 	rendercheck.h \
 	tests.c \
 	t_blend.c \
+	t_bug7366.c \
 	t_composite.c \
 	t_dstcoords.c \
 	t_fill.c \
diff --git a/main.c b/main.c
index 067edd1..2a1fc58 100644
--- a/main.c
+++ b/main.c
@@ -192,6 +192,8 @@ int main(int argc, char **argv)
 					enabled_tests |= TEST_REPEAT;
 				} else if (strcmp(test, "triangles") == 0) {
 					enabled_tests |= TEST_TRIANGLES;
+				} else if (strcmp(test, "bug7366") == 0) {
+					enabled_tests |= TEST_BUG7366;
 				} else {
 					usage(argv[0]);
 				}
diff --git a/rendercheck.1 b/rendercheck.1
index c93649e..c1f2f5d 100644
--- a/rendercheck.1
+++ b/rendercheck.1
@@ -29,7 +29,8 @@ Enables synchronous xlib operation, for 
 .BI \-t|\-\-tests\ test1,test2,test3...
 Enables only a specific subset of the possible tests.  Test names include 
 fill, dcoords, scoords, mcoords, tscoords, tmcoords, blend, composite,
-cacomposite, gradients, repeat, and triangles.  Names must be separated by
+cacomposite, gradients, repeat, triangles, and bug7366.
+Names must be separated by
 commas and have no spaces.
 .TP
 .BI \-o|\-\-ops
diff --git a/rendercheck.h b/rendercheck.h
index 50296b3..3a4f8c5 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -79,6 +79,7 @@ struct op_info {
 #define TEST_GRADIENTS  	0x0200
 #define TEST_REPEAT	  	0x0400
 #define TEST_TRIANGLES  	0x0800
+#define TEST_BUG7366		0x1000
 
 extern int pixmap_move_iter;
 extern int win_width, win_height;
@@ -169,3 +170,6 @@ tristrip_test(Display *dpy, picture_info
 Bool
 trifan_test(Display *dpy, picture_info *win, picture_info *dst, int op,
     picture_info *src_color, picture_info *dst_color);
+
+Bool
+bug7366_test(Display *dpy);
diff --git a/tests.c b/tests.c
index b8edcfd..95323bf 100644
--- a/tests.c
+++ b/tests.c
@@ -706,6 +706,16 @@ do {								\
 		success_mask |= TEST_TRIANGLES;
 	}
 
+        if (enabled_tests & TEST_BUG7366) {
+	    Bool ok, group_ok = TRUE;
+
+	    ok = bug7366_test(dpy);
+	    RECORD_RESULTS();
+
+	    if (group_ok)
+		success_mask |= TEST_BUG7366;
+	}
+
 	printf("%d tests passed of %d total\n", tests_passed, tests_total);
 
 	return tests_passed == tests_total;
diff-tree 388f4492b3099546a2af89e59bc8807709508b53 (from f678d50210e81941790f2db72c12563d411006d9)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Mon Jun 19 17:58:45 2006 -0700

    Add a -o flag to select a subset of the Render operators for testing.

diff --git a/main.c b/main.c
index 2ce04b1..067edd1 100644
--- a/main.c
+++ b/main.c
@@ -104,7 +104,8 @@ static void
 usage (char *program)
 {
     fprintf(stderr, "usage: %s [-d|--display display] [-v|--verbose]\n"
-	"\t[-t test1,test2,...] [--sync] [--minimalrendering]\n"
+	"\t[-t test1,test2,...] [-o op1,op2,...] [--sync]"
+	"\t[--minimalrendering]\n"
             "\tAvailable tests: dcoors,scoords,mcoords,tscoords,\n"
             "\t\ttmcoords,blend,composite,cacomposite,gradients,repeat,triangles\n",
 	program);
@@ -121,12 +122,13 @@ int main(int argc, char **argv)
 	XSetWindowAttributes as;
 	picture_info window;
 	char *display = NULL;
-	char *test, *nextname;
+	char *test, *opname, *nextname;
 
 	static struct option longopts[] = {
 		{ "display",	required_argument,	NULL,	'd' },
 		{ "iterations",	required_argument,	NULL,	'i' },
 		{ "tests",	required_argument,	NULL,	't' },
+		{ "ops",	required_argument,	NULL,	'o' },
 		{ "verbose",	no_argument,		NULL,	'v' },
 		{ "sync",	no_argument,		&is_sync, 1},
 		{ "minimalrendering", no_argument,	&minimalrendering,
@@ -134,7 +136,7 @@ int main(int argc, char **argv)
 		{ NULL,		0,			NULL,	0 }
 	};
 
-	while ((o = getopt_long(argc, argv, "d:i:t:v", longopts, NULL)) != -1) {
+	while ((o = getopt_long(argc, argv, "d:i:t:o:v", longopts, NULL)) != -1) {
 		switch (o) {
 		case 'd':
 			display = optarg;
@@ -142,6 +144,23 @@ int main(int argc, char **argv)
 		case 'i':
 			pixmap_move_iter = atoi(optarg);
 			break;
+		case 'o':
+			for (i = 0; i < num_ops; i++)
+				ops[i].disabled = TRUE;
+
+			nextname = optarg;
+			while ((opname = strsep(&nextname, ",")) != NULL) {
+				for (i = 0; i < num_ops; i++) {
+					if (strcasecmp(ops[i].name, opname) !=
+					    0)
+						continue;
+					ops[i].disabled = FALSE;
+					break;
+				}
+				if (i == num_ops)
+					usage(argv[0]);
+			}
+			break;
 		case 't':
 			nextname = optarg;
 
diff --git a/rendercheck.1 b/rendercheck.1
index ed8fce5..c93649e 100644
--- a/rendercheck.1
+++ b/rendercheck.1
@@ -5,7 +5,8 @@ rendercheck \- simple tests of the X Ren
 .SH SYNOPSIS
 .nf
 .B rendercheck [\-d|\-\-display display] [\-i|\-\-iter] [\-\-sync] \
-[\-t|\-\-tests test1,test2,test3,...] [\-v|\-\-verbose] [\-\-minimalrendering]
+[\-t|\-\-tests test1,test2,test3,...] [\-o|\-\-ops op1,op2,op3,...]
+[\-v|\-\-verbose] [\-\-minimalrendering]
 .fi
 .SH DESCRIPTION
 .B rendercheck
@@ -31,6 +32,9 @@ fill, dcoords, scoords, mcoords, tscoord
 cacomposite, gradients, repeat, and triangles.  Names must be separated by
 commas and have no spaces.
 .TP
+.BI \-o|\-\-ops
+Enables only a specific subset of the Render operators.
+.TP
 .BI \-v|\-\-verbose
 Enables verbose printing of information on tests run, and successes and
 failures.
diff --git a/rendercheck.h b/rendercheck.h
index 24f2925..50296b3 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -64,6 +64,7 @@ typedef struct _picture_info {
 struct op_info {
 	int op;
 	char *name;
+	Bool disabled;
 };
 
 #define TEST_FILL		0x0001
diff --git a/tests.c b/tests.c
index ca8c677..b8edcfd 100644
--- a/tests.c
+++ b/tests.c
@@ -466,6 +466,9 @@ do {								\
 		Bool ok, group_ok = TRUE;
 
 		for (i = 0; i < num_ops; i++) {
+		    if (ops[i].disabled)
+			continue;
+
 		    for (j = 0; j <= num_dests; j++) {
 			picture_info *pi;
 
@@ -504,6 +507,9 @@ do {								\
 		Bool ok, group_ok = TRUE;
 
 		for (i = 0; i < num_ops; i++) {
+		    if (ops[i].disabled)
+			continue;
+
 		    for (j = 0; j <= num_dests; j++) {
 			picture_info *pi;
 
@@ -550,6 +556,9 @@ do {								\
 		Bool ok, group_ok = TRUE;
 
 		for (i = 0; i < num_ops; i++) {
+		    if (ops[i].disabled)
+			continue;
+
 		    for (j = 0; j <= num_dests; j++) {
 			picture_info *pi;
 
@@ -596,6 +605,9 @@ do {								\
 	    Bool ok, group_ok = TRUE;
 
             for (i = 0; i < num_ops; i++) {
+		if (ops[i].disabled)
+		    continue;
+
                 for (j = 0; j <= num_dests; j++) {
                     picture_info *pi;
                     
@@ -623,6 +635,9 @@ do {								\
 	    Bool ok, group_ok = TRUE;
 
             for (i = 0; i < num_ops; i++) {
+		if (ops[i].disabled)
+		    continue;
+
                 for (j = 0; j <= num_dests; j++) {
                     picture_info *pi;
                     
@@ -657,6 +672,9 @@ do {								\
 	    Bool ok, group_ok = TRUE;
 
 	    for (i = 0; i < num_ops; i++) {
+		if (ops[i].disabled)
+		    continue;
+
 		for (j = 0; j <= num_dests; j++) {
 			picture_info *pi;
 



More information about the xorg-commit mailing list