Add Radek Doulík.

Add test exposing a BadValue (0-size pixmap) bug in cairo-xlib-surface when everything is clipped away (thanks to Radek Doulík <rodo@novell.com>).
This commit is contained in:
Carl Worth 2005-08-31 09:00:01 +00:00
parent 44d6afc8a8
commit 464c6dffcf
6 changed files with 85 additions and 0 deletions

View file

@ -8,6 +8,7 @@ Damien Carbery <damien.carbery@sun.com> Build fixes
Andrew Chant <andrew.chant@utoronto.ca> Adding const where needed
Steve Chaplin <stevech1097@yahoo.com.au> Bug fixes for PNG reading
Tomasz Cholewo <cholewo@ieee-cis.org> Bug fixes
Radek Doulík <rodo@novell.com> Bug report and test case
John Ehresman <jpe@wingide.com> Build fixes for win32
John Ellson <ellson@research.att.com> First font/glyph extents functions
Behdad Esfahbod <behdad@behdad.org> Release script improvements, bug fixes.

View file

@ -1,3 +1,13 @@
2005-08-31 Carl Worth <cworth@cworth.org>
* AUTHORS: Add Radek Doulík.
* test/.cvsignore:
* test/Makefile.am:
* test/clip-all.c: (draw), (main): Add test exposing a BadValue
(0-size pixmap) bug in cairo-xlib-surface when everything is
clipped away (thanks to Radek Doulík <rodo@novell.com>).
2005-08-30 Owen Taylor <otaylor@redhat.com>
* src/cairo-xlib-surface.c (_cairo_xlib_surface_create_internal):

View file

@ -4,6 +4,7 @@ Makefile
Makefile.in
a8-mask
caps-sub-paths
clip-all
clip-nesting
clip-operator
clip-twice

View file

@ -2,6 +2,7 @@
TESTS = \
a8-mask \
caps-sub-paths \
clip-all \
clip-nesting \
clip-operator \
clip-twice \
@ -77,6 +78,7 @@ endif
EXTRA_DIST = \
a8-mask-ref.png \
caps-sub-paths-ref.png \
clip-all-ref.png \
clip-nesting-ref.png \
clip-operator-ref.png \
clip-twice-ref.png \
@ -140,6 +142,7 @@ rel-path-ref.png
# provide an explanation for the expected failure.
XFAIL_TESTS = \
a8-mask \
clip-all \
filter-nearest-offset \
pixman-rotate \
self-intersecting \
@ -184,6 +187,7 @@ endif
# from autogen.sh. My, but this is painful...
a8_mask_LDADD = $(LDADDS)
caps_sub_paths_LDADD = $(LDADDS)
clip_all_LDADD = $(LDADDS)
clip_nesting_LDADD = $(LDADDS)
clip_operator_LDADD = $(LDADDS)
clip_twice_LDADD = $(LDADDS)

BIN
test/clip-all-ref.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

69
test/clip-all.c Normal file
View file

@ -0,0 +1,69 @@
/*
* Copyright © 2005 Novell, 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
* Novell, Inc. not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Novell, Inc. makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL NOVELL, 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: Radek Doulík <rodo@novell.com>
*/
#include "cairo-test.h"
#define SIZE 10
#define CLIP_SIZE 2
cairo_test_t test = {
"clip-all",
"Test clipping with everything clipped out",
SIZE, SIZE
};
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_set_source_rgb (cr, 0, 0, 1);
cairo_fill (cr);
cairo_reset_clip (cr);
cairo_rectangle (cr, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
cairo_clip (cr);
cairo_rectangle (cr, 3*CLIP_SIZE, 3*CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
cairo_clip (cr);
cairo_translate (cr, .5, .5);
cairo_reset_clip (cr);
cairo_rectangle (cr, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
cairo_clip (cr);
cairo_rectangle (cr, 3*CLIP_SIZE, 3*CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
cairo_clip (cr);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_set_source_rgb (cr, 1, 1, 0);
cairo_fill (cr);
return CAIRO_TEST_SUCCESS;
}
int
main (void)
{
return cairo_test (&test, draw);
}