[cairo] Pixel consistency? (testing)

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 19 07:15:54 PDT 2009


Excerpts from Ian Britten's message of Wed Aug 19 12:36:15 +0100 2009:
> Could you explain how you'd utilize either format for unit testing?
> 
> My first assumption would be to simply do a textual line-by-line diff
> of the outputs.  However, it seems that for either format, any
> formatting changes by Cairo between versions would trigger failures
> (Analogous to the failures I see when just comparing image pixels).

I was thinking more along the lines of grep rather than diff, but I see
your point. The capabilities of cairo will grow over time, though we are
trying to avoid wanton feature creep, and so the XML output will
undoubtably alter over time.

Instead the best I can suggest is that you have a mock library instead
of cairo calls so that you have full control over the logging during
your units tests. My aim is simply that you avoid black-box testing of
cairo - as you have the source and we will happily accept patches to
improve the test suite.

Aside: I've been having good results with using a 3x3 median filter to
ignore antialiasing issues between different cairo version.

Hope this helps!
-ickle


More information about the cairo mailing list