[cairo-commit] 3 commits - Makefile.am test/cairo-test.c
test/dash-no-dash.c test/dash-no-dash-ref.png test/.gitignore
test/Makefile.am
Carl Worth
cworth at kemper.freedesktop.org
Thu Jul 13 10:19:51 PDT 2006
Makefile.am | 6 ++
test/.gitignore | 3 -
test/Makefile.am | 8 ++-
test/cairo-test.c | 6 +-
test/dash-no-dash-ref.png |binary
test/dash-no-dash.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 110 insertions(+), 8 deletions(-)
New commits:
diff-tree d2d9a74c77d6bbc51502cee2288fd7d76c30f926 (from f3d45d17902cb109dacf30d826ea8f93408473ba)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Jul 12 14:49:14 2006 -0700
Add dash-no-dash test case to demonstrate PDF failure to turn off dashing.
diff --git a/test/.gitignore b/test/.gitignore
index a0255e7..1b6b64e 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -25,8 +25,9 @@ create-for-stream.svg
create-from-png
create-from-png-stream
dash-caps-joins
-dash-scale
+dash-no-dash
dash-offset-negative
+dash-scale
dash-zero-length
degenerate-path
device-offset
diff --git a/test/Makefile.am b/test/Makefile.am
index f5d4f44..d4a76fa 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -17,8 +17,9 @@ create-for-stream \
create-from-png \
create-from-png-stream \
dash-caps-joins \
-dash-scale \
+dash-no-dash \
dash-offset-negative \
+dash-scale \
dash-zero-length \
degenerate-path \
device-offset \
@@ -179,10 +180,11 @@ create-from-png-ref.png \
create-from-png-stream-ref.png \
dash-caps-joins-ref.png \
dash-caps-joins-ps-argb32-ref.png \
-dash-scale-ref.png \
-dash-scale-ps-argb32-ref.png \
+dash-no-dash-ref.png \
dash-offset-negative-ref.png \
dash-offset-negative-ps-argb32-ref.png \
+dash-scale-ref.png \
+dash-scale-ps-argb32-ref.png \
dash-zero-length-ref.png \
dash-zero-length-rgb24-ref.png \
dash-zero-length-ps-argb32-ref.png \
diff --git a/test/dash-no-dash-ref.png b/test/dash-no-dash-ref.png
new file mode 100644
index 0000000..9afd045
Binary files /dev/null and b/test/dash-no-dash-ref.png differ
diff --git a/test/dash-no-dash.c b/test/dash-no-dash.c
new file mode 100644
index 0000000..21235b9
--- /dev/null
+++ b/test/dash-no-dash.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright © 2006 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#include "cairo-test.h"
+#include <stdlib.h>
+
+#define PAD 1
+#define LINE_WIDTH 2
+#define HEIGHT (PAD + 4 * (LINE_WIDTH + PAD))
+#define WIDTH 16
+
+static cairo_test_draw_function_t draw;
+
+cairo_test_t test = {
+ "dash-no-dash",
+ "Tests that we can actually turn dashing on and off again",
+ WIDTH, HEIGHT,
+ draw
+};
+
+static void
+line (cairo_t *cr)
+{
+ cairo_move_to (cr, PAD, 0.0);
+ cairo_line_to (cr, WIDTH - PAD, 0.0);
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ double dash = 2.0;
+
+ /* We draw in black, so paint white first. */
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
+ cairo_paint (cr);
+
+ cairo_set_source_rgb (cr, 0, 0, 0); /* black */
+
+ cairo_translate (cr, 0.0, PAD + LINE_WIDTH / 2);
+
+ /* First draw a solid line... */
+ line (cr);
+ cairo_stroke (cr);
+
+ cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
+
+ /* then a dashed line... */
+ cairo_set_dash (cr, &dash, 1, 0.0);
+ line (cr);
+ cairo_stroke (cr);
+
+ cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
+
+ /* back to solid... */
+ cairo_set_dash (cr, NULL, 0, 0.0);
+ line (cr);
+ cairo_stroke (cr);
+
+ cairo_translate (cr, 0.0, LINE_WIDTH + PAD);
+
+ /* and finally, back to dashed. */
+ cairo_set_dash (cr, &dash, 1, 0.0);
+ line (cr);
+ cairo_stroke (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
diff-tree f3d45d17902cb109dacf30d826ea8f93408473ba (from 65d0431b98e7e8d966bbcb43a542a86a9c95e0dc)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Jul 13 10:04:55 2006 -0700
Eliminate a few simple compiler warnings
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 94d3b1e..3945182 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1637,8 +1637,8 @@ cairo_test_expecting (cairo_test_t *test
/* we use volatile here to make sure values are not clobbered
* by longjmp */
volatile int i, j, num_targets;
- volatile limited_targets = 0;
- const char *tname;
+ volatile int limited_targets = 0;
+ char *tname;
void (*old_segfault_handler)(int);
volatile cairo_test_status_t status, ret;
volatile cairo_test_target_t **targets_to_test;
@@ -1799,7 +1799,7 @@ cairo_test_expecting (cairo_test_t *test
while (*tname) {
int found = 0;
- const char *end = strpbrk (tname, " \t\r\n;:,");
+ char *end = strpbrk (tname, " \t\r\n;:,");
if (!end)
end = tname + strlen (tname);
diff-tree 65d0431b98e7e8d966bbcb43a542a86a9c95e0dc (from da0f348350c3ca28d40601aefbca12903632cc18)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Jul 13 10:04:19 2006 -0700
Add retest and recheck targets to the top-level Makefile
diff --git a/Makefile.am b/Makefile.am
index 7855fd6..8052534 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,10 @@ doc:
-$(MAKE) -C doc doc
test:
-$(MAKE) -C test test
+retest:
+ -$(MAKE) -C test retest
+recheck:
+ -$(MAKE) -C test recheck
# libpng is required for our test programs
if CAIRO_HAS_PNG_FUNCTIONS
@@ -203,4 +207,4 @@ docs-publish: all
scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) cairo-manual.tar.gz"
-.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish
+.PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish test retest recheck
More information about the cairo-commit
mailing list