[cairo-commit] cairo/test pdf-surface.c,1.5,1.6
Carl Worth
commit at pdx.freedesktop.org
Tue May 17 00:34:13 PDT 2005
Committed by: cworth
Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv8539/test
Modified Files:
pdf-surface.c
Log Message:
* test/pdf-surface.c: (main): Update to the latest PDF surface API
changes: use filename not FILE* and use surface dimension in
points, not inches.
Index: pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/pdf-surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pdf-surface.c 14 May 2005 20:51:59 -0000 1.5
+++ pdf-surface.c 17 May 2005 07:34:11 -0000 1.6
@@ -25,6 +25,7 @@
#include <stdio.h>
+#include <cairo-pdf.h>
#include "cairo-test.h"
/* Pretty boring test just to make sure things aren't crashing ---
@@ -36,19 +37,18 @@
{
cairo_t *cr;
const char *filename = "pdf-surface.pdf";
- FILE *file;
cairo_surface_t *surface;
printf("\n");
- file = fopen (filename, "w");
- if (!file) {
- cairo_test_log ("Failed to open file %s\n", filename);
+
+ surface = cairo_pdf_surface_create (filename,
+ 29.7 * 182.88,
+ 21.0 * 182.88);
+ if (surface == NULL) {
+ cairo_test_log ("Failed to create pdf surface for file %s\n", filename);
return CAIRO_TEST_FAILURE;
}
- surface = cairo_pdf_surface_create (file,
- 297 / 25.4,
- 210 / 25.4);
cr = cairo_create (surface);
cairo_rectangle (cr, 10, 10, 100, 100);
@@ -57,10 +57,8 @@
cairo_show_page (cr);
- cairo_surface_destroy (surface);
cairo_destroy (cr);
-
- fclose (file);
+ cairo_surface_destroy (surface);
return 0;
}
More information about the cairo-commit
mailing list