The ARRAY_LENGTH macro is used by many tests, although sometimes it is
named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it.
In a similar way, MAX() and MIN() are currently defined in some
specific tests, while they could be reused.
A push/pop is an implicit save/restore, so a clip applied inside the
group is temporary, whereas a clip applied outside affects both the
geometry inside *and* the application of the group when painted. So
reset the clip afterwards to get the desired behaviour.
The clip-group-shapes-* tests check that it doesn't
matter whether the clip path is set before or after
pushing a group using specific types of clip paths
(aligned/unaligned rectangles and general paths.)