~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to test/nil-surface.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
static cairo_test_draw_function_t draw;
37
37
 
38
 
cairo_test_t test = {
 
38
static const cairo_test_t test = {
39
39
    "nil-surface",
40
40
    "Test that nil surfaces do not make cairo crash.",
41
41
    1, 1,
45
45
static cairo_test_status_t
46
46
draw (cairo_t *cr, int width, int height)
47
47
{
 
48
    const cairo_test_context_t *ctx = cairo_test_get_context (cr);
48
49
    cairo_surface_t *surface;
49
50
    cairo_pattern_t *pattern;
50
51
    cairo_t *cr2;
71
72
 
72
73
    /* Check that the error made it all that way. */
73
74
    if (cairo_status (cr2) != CAIRO_STATUS_FILE_NOT_FOUND) {
74
 
        cairo_test_log ("Error: Received status of \"%s\" rather than expected \"%s\"\n",
 
75
        cairo_test_log (ctx, "Error: Received status of \"%s\" rather than expected \"%s\"\n",
75
76
                        cairo_status_to_string (cairo_status (cr2)),
76
77
                        cairo_status_to_string (CAIRO_STATUS_FILE_NOT_FOUND));
77
78
        cairo_destroy (cr2);
96
97
 
97
98
    /* Check that the error made it all that way. */
98
99
    if (cairo_status (cr2) != CAIRO_STATUS_NULL_POINTER) {
99
 
        cairo_test_log ("Error: Received status of \"%s\" rather than expected \"%s\"\n",
 
100
        cairo_test_log (ctx, "Error: Received status of \"%s\" rather than expected \"%s\"\n",
100
101
                        cairo_status_to_string (cairo_status (cr2)),
101
102
                        cairo_status_to_string (CAIRO_STATUS_NULL_POINTER));
102
103
        cairo_destroy (cr2);
127
128
    /* Trigger invalid restore. */
128
129
    cairo_restore (cr2);
129
130
    if (cairo_status (cr2) != CAIRO_STATUS_INVALID_RESTORE) {
130
 
        cairo_test_log ("Error: Received status of \"%s\" rather than expected \"%s\"\n",
 
131
        cairo_test_log (ctx, "Error: Received status of \"%s\" rather than expected \"%s\"\n",
131
132
                        cairo_status_to_string (cairo_status (cr2)),
132
133
                        cairo_status_to_string (CAIRO_STATUS_INVALID_RESTORE));
133
134
        cairo_destroy (cr2);
145
146
    cr2 = cairo_create (NULL);
146
147
 
147
148
    if (cairo_status (cr2) != CAIRO_STATUS_NULL_POINTER) {
148
 
        cairo_test_log ("Error: Received status of \"%s\" rather than expected \"%s\"\n",
 
149
        cairo_test_log (ctx, "Error: Received status of \"%s\" rather than expected \"%s\"\n",
149
150
                        cairo_status_to_string (cairo_status (cr2)),
150
151
                        cairo_status_to_string (CAIRO_STATUS_NULL_POINTER));
151
152
        cairo_destroy (cr2);
154
155
 
155
156
    /* Test that get_target returns something valid */
156
157
    if (cairo_get_target (cr2) == NULL) {
157
 
        cairo_test_log ("Error: cairo_get_target() returned NULL\n");
 
158
        cairo_test_log (ctx, "Error: cairo_get_target() returned NULL\n");
158
159
        cairo_destroy (cr2);
159
160
        return CAIRO_TEST_FAILURE;
160
161
    }