Note that text_cache_crash is expected to fail.

Add test to demonstrate bug when item is too big for cache.
Really remove that refcount assertion this time.
This commit is contained in:
Carl Worth 2004-11-23 13:38:09 +00:00
parent 7478ea5051
commit 5c143241df
7 changed files with 22 additions and 10 deletions

View file

@ -1,5 +1,14 @@
2004-11-23 Carl Worth <cworth@cworth.org>
* test/Makefile.am (XFAIL_TESTS): Note that text_cache_crash is
expected to fail.
* test/text_cache_crash.c (draw): Add test to demonstrate bug when
item is too big for cache.
* src/cairo_cache.c (_cache_sane_state): Really remove that
refcount assertion this time.
* test/text_cache_crash.c: Add note that bug has been fixed.
(main): Instrumentation code for testing cache destruction.

View file

@ -121,9 +121,6 @@ _cache_sane_state (cairo_cache_t *cache)
assert (cache->entries != NULL);
assert (cache->backend != NULL);
assert (cache->arrangement != NULL);
/* XXX: This check is broken during destroy
assert (cache->refcount > 0);
*/
assert (cache->used_memory <= cache->max_memory);
assert (cache->live_entries <= cache->arrangement->size);
}

View file

@ -121,9 +121,6 @@ _cache_sane_state (cairo_cache_t *cache)
assert (cache->entries != NULL);
assert (cache->backend != NULL);
assert (cache->arrangement != NULL);
/* XXX: This check is broken during destroy
assert (cache->refcount > 0);
*/
assert (cache->used_memory <= cache->max_memory);
assert (cache->live_entries <= cache->arrangement->size);
}

View file

@ -121,9 +121,6 @@ _cache_sane_state (cairo_cache_t *cache)
assert (cache->entries != NULL);
assert (cache->backend != NULL);
assert (cache->arrangement != NULL);
/* XXX: This check is broken during destroy
assert (cache->refcount > 0);
*/
assert (cache->used_memory <= cache->max_memory);
assert (cache->live_entries <= cache->arrangement->size);
}

View file

@ -13,7 +13,6 @@ EXTRA_DIST = \
fill_rule-ref.png \
line_width-ref.png \
move_to_show_surface-ref.png \
text_cache_crash-ref.png \
text_rotate-ref.png
# This list is only for known bugs (not regressions). We do need to
@ -26,6 +25,7 @@ text_rotate-ref.png
# be fixed before the code is committed.
XFAIL_TESTS = \
move_to_show_surface \
text_cache_crash \
text_rotate
check_PROGRAMS = $(TESTS)

View file

@ -72,6 +72,7 @@ cairo_test_t test = {
static void
draw (cairo_t *cr, int width, int height)
{
/* Once there was a bug that choked when selecting the same font twice. */
cairo_select_font(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_scale_font(cr, 40.0);
@ -79,6 +80,11 @@ draw (cairo_t *cr, int width, int height)
cairo_scale_font(cr, 40.0);
cairo_move_to(cr, 10, 50);
cairo_show_text(cr, "hello");
/* Then there was a bug that choked when selecting a font too big
* for the cache. */
cairo_scale_font (cr, 500);
cairo_show_text (cr, "hello");
}
int

View file

@ -72,6 +72,7 @@ cairo_test_t test = {
static void
draw (cairo_t *cr, int width, int height)
{
/* Once there was a bug that choked when selecting the same font twice. */
cairo_select_font(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_scale_font(cr, 40.0);
@ -79,6 +80,11 @@ draw (cairo_t *cr, int width, int height)
cairo_scale_font(cr, 40.0);
cairo_move_to(cr, 10, 50);
cairo_show_text(cr, "hello");
/* Then there was a bug that choked when selecting a font too big
* for the cache. */
cairo_scale_font (cr, 500);
cairo_show_text (cr, "hello");
}
int