[cairo-commit] cairo/test Makefile.am, 1.19, 1.20 cairo_test.c, 1.11, 1.12 get_and_set.c, NONE, 1.1

Carl Worth commit at pdx.freedesktop.org
Wed Mar 9 14:34:28 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv9566

Modified Files:
	Makefile.am cairo_test.c 
Added Files:
	get_and_set.c 
Log Message:

        * test/cairo_test.c (cairo_test): Move filename initialization up
        to before first use.

        * test/get_and_set.c:
        * test/Makefile.am: Add test for the most trivial cairo_get and
        cairo_set functions.


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Makefile.am	9 Mar 2005 03:30:19 -0000	1.19
+++ Makefile.am	9 Mar 2005 22:34:26 -0000	1.20
@@ -1,15 +1,17 @@
 # All new test cases go here
 TESTS = 		\
+clip_twice		\
+coverage		\
 fill_rule		\
+get_and_set		\
 leaky_polygon		\
 line_width		\
 linear_gradient		\
 move_to_show_surface	\
+pixman_rotate		\
 text_cache_crash	\
-text_rotate		\
-coverage		\
-clip_twice		\
-pixman_rotate
+text_rotate
+
 
 # And all new tests go here too. I really don't like having to repeat
 # this list. Anyone know a good way to avoid it? Can I use a wildcard
@@ -66,16 +68,17 @@
 # ARGH! I have to repeat the list of tests a third time. Maybe it's
 # time to break down and auto-generate the Makefile.am or something
 # from autogen.sh. My, but this is painful...
+clip_twice_SOURCES = clip_twice.c $(cairo_test_lib)
+coverage_SOURCES = coverage.c $(cairo_test_lib)
 fill_rule_SOURCES = fill_rule.c $(cairo_test_lib)
+get_and_set_SOURCES = get_and_set.c $(cairo_test_lib)
 leaky_polygon_SOURCES = leaky_polygon.c $(cairo_test_lib)
 line_width_SOURCES = line_width.c $(cairo_test_lib)
 linear_gradient_SOURCES = linear_gradient.c $(cairo_test_lib)
 move_to_show_surface_SOURCES = move_to_show_surface.c $(cairo_test_lib)
+pixman_rotate_SOURCES = pixman_rotate.c $(cairo_test_lib)
 text_cache_crash_SOURCES = text_cache_crash.c $(cairo_test_lib)
 text_rotate_SOURCES = text_rotate.c $(cairo_test_lib)
-coverage_SOURCES = coverage.c $(cairo_test_lib)
-clip_twice_SOURCES = clip_twice.c $(cairo_test_lib)
-pixman_rotate_SOURCES = pixman_rotate.c $(cairo_test_lib)
 
 noinst_PROGRAMS = imagediff
 imagediff_SOURCES = imagediff.c $(cairo_test_lib)

Index: cairo_test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo_test.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cairo_test.c	9 Mar 2005 21:58:20 -0000	1.11
+++ cairo_test.c	9 Mar 2005 22:34:26 -0000	1.12
@@ -113,7 +113,16 @@
 
     xunlink (log_name);
 
-    /* The cairo part of the test is the easiest part */
+    /* Get the strings ready that we'll need. */
+    srcdir = getenv ("srcdir");
+    if (!srcdir)
+	srcdir = ".";
+    xasprintf (&log_name, "%s%s", test->name, CAIRO_TEST_LOG_SUFFIX);
+    xasprintf (&png_name, "%s%s", test->name, CAIRO_TEST_PNG_SUFFIX);
+    xasprintf (&ref_name, "%s/%s%s", srcdir, test->name, CAIRO_TEST_REF_SUFFIX);
+    xasprintf (&diff_name, "%s%s", test->name, CAIRO_TEST_DIFF_SUFFIX);
+
+    /* Run the actual drawing code. */
     cr = cairo_create ();
 
     stride = 4 * test->width;
@@ -125,6 +134,8 @@
 			    test->width, test->height, stride);
 
     status = (draw) (cr, test->width, test->height);
+
+    /* Then, check all the different ways it could fail. */
     if (status) {
 	log_file = fopen (log_name, "a");
 	fprintf (log_file, "Error: Function under test failed\n");
@@ -148,15 +159,6 @@
 	return CAIRO_TEST_SUCCESS;
     }
 
-    /* Then we've got a bunch of string manipulation and file I/O for the check */
-    srcdir = getenv ("srcdir");
-    if (!srcdir)
-	srcdir = ".";
-    xasprintf (&log_name, "%s%s", test->name, CAIRO_TEST_LOG_SUFFIX);
-    xasprintf (&png_name, "%s%s", test->name, CAIRO_TEST_PNG_SUFFIX);
-    xasprintf (&ref_name, "%s/%s%s", srcdir, test->name, CAIRO_TEST_REF_SUFFIX);
-    xasprintf (&diff_name, "%s%s", test->name, CAIRO_TEST_DIFF_SUFFIX);
-
     png_file = fopen (png_name, "w");
     write_png_argb32 (png_buf, png_file, test->width, test->height, stride);
     fclose (png_file);

--- NEW FILE: get_and_set.c ---
(This appears to be a binary file; contents omitted.)




More information about the cairo-commit mailing list