diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | test/.cvsignore | 1 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/cairo-test.c | 4 | ||||
-rw-r--r-- | test/cairo-test.h | 1 | ||||
-rw-r--r-- | test/create-for-png.c | 2 | ||||
-rw-r--r-- | test/create-from-png.c | 2 | ||||
-rw-r--r-- | test/pdf-surface.c | 65 | ||||
-rw-r--r-- | test/pixman-rotate.c | 1 |
9 files changed, 84 insertions, 8 deletions
@@ -1,3 +1,17 @@ +2005-04-26 Carl Worth <cworth@cworth.org> + + * test/.cvsignore: + * test/Makefile.am: + * test/cairo-test.h: + * test/pdf-surface.c: (main): Add very simple test to generate PDF + output, (no automated verification yet). + + * test/cairo-test.c: (cairo_test): + * test/create-for-png.c: (draw): + * test/pixman-rotate.c: Track PNG interface changes, (no more + include of cairo-png.h, cairo_surface_write_png renamed to + cairo_surface_write_to_png). + 2005-04-26 Kristian Høgsberg <krh@redhat.com> * src/cairo-png.h: Prototypes moved to cairo.h, this file removed. diff --git a/test/.cvsignore b/test/.cvsignore index dae22bad6..b5ff816eb 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -15,6 +15,7 @@ line-width linear-gradient move-to-show-surface path-data +pdf-surface pixman-rotate set-source select-font-no-show-text diff --git a/test/Makefile.am b/test/Makefile.am index 67a1fafa3..e2a531045 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,6 +12,7 @@ line-width \ linear-gradient \ move-to-show-surface \ path-data \ +pdf-surface \ pixman-rotate \ select-font-no-show-text\ set-source \ @@ -104,6 +105,7 @@ line_width_LDADD = $(LDADDS) linear_gradient_LDADD = $(LDADDS) move_to_show_surface_LDADD = $(LDADDS) path_data_LDADD = $(LDADDS) +pdf_surface_LDADD = $(LDADDS) pixman_rotate_LDADD = $(LDADDS) select_font_no_show_text_LDADD = $(LDADDS) set_source_LDADD = $(LDADDS) diff --git a/test/cairo-test.c b/test/cairo-test.c index e222d87e1..78114b7ba 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -32,8 +32,6 @@ #include "cairo-test.h" -#include <cairo-png.h> - #include "buffer-diff.h" #include "read-png.h" #include "write-png.h" @@ -169,7 +167,7 @@ cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw) return CAIRO_TEST_SUCCESS; } - cairo_surface_write_png (cairo_get_target_surface (cr), png_name); + cairo_surface_write_to_png (cairo_get_target_surface (cr), png_name); cairo_destroy (cr); diff --git a/test/cairo-test.h b/test/cairo-test.h index 27efacc0c..ce7ecda86 100644 --- a/test/cairo-test.h +++ b/test/cairo-test.h @@ -28,6 +28,7 @@ #include <math.h> #include <cairo.h> +#include <cairo-pdf.h> typedef enum cairo_test_status { CAIRO_TEST_SUCCESS = 0, diff --git a/test/create-for-png.c b/test/create-for-png.c index 4a93905ef..861801501 100644 --- a/test/create-for-png.c +++ b/test/create-for-png.c @@ -26,7 +26,6 @@ #include "cairo-test.h" #include <stdlib.h> -#include <cairo-png.h> #define WIDTH 2 #define HEIGHT 2 @@ -42,7 +41,6 @@ draw (cairo_t *cr, int width, int height) { char *srcdir = getenv ("srcdir"); char *filename; - FILE *file; cairo_surface_t *surface; int png_width, png_height; diff --git a/test/create-from-png.c b/test/create-from-png.c index 4a93905ef..861801501 100644 --- a/test/create-from-png.c +++ b/test/create-from-png.c @@ -26,7 +26,6 @@ #include "cairo-test.h" #include <stdlib.h> -#include <cairo-png.h> #define WIDTH 2 #define HEIGHT 2 @@ -42,7 +41,6 @@ draw (cairo_t *cr, int width, int height) { char *srcdir = getenv ("srcdir"); char *filename; - FILE *file; cairo_surface_t *surface; int png_width, png_height; diff --git a/test/pdf-surface.c b/test/pdf-surface.c new file mode 100644 index 000000000..6da15e23f --- /dev/null +++ b/test/pdf-surface.c @@ -0,0 +1,65 @@ +/* + * Copyright © 2005 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@cworth.org> + */ + +#include <stdio.h> + +#include "cairo-test.h" + +/* Pretty boring test just to make sure things aren't crashing --- + * no verification that we're getting good results yet. +*/ + +int +main (void) +{ + cairo_t *cr; + const char *filename = "pdf-surface.pdf"; + FILE *file; + + file = fopen (filename, "w"); + if (!file) { + fprintf (stderr, "Failed to open file %s\n", filename); + return CAIRO_TEST_FAILURE; + } + + cr = cairo_create (); + + cairo_set_target_pdf (cr, file, + 297 / 25.4, + 210 / 25.4, + 300.0, 300.0); + + cairo_rectangle (cr, 10, 10, 100, 100); + cairo_set_source_rgb (cr, 1, 0, 0); + cairo_fill (cr); + + cairo_show_page (cr); + + cairo_destroy (cr); + + fclose (file); + + return 0; +} diff --git a/test/pixman-rotate.c b/test/pixman-rotate.c index 93f9c866f..624bc2f38 100644 --- a/test/pixman-rotate.c +++ b/test/pixman-rotate.c @@ -4,7 +4,6 @@ #include <math.h> #include <cairo.h> -#include <cairo-png.h> #include <cairo-pdf.h> #include "cairo-test.h" |