Testing Applications

In a well tuned X server, often many paths through the code are possible given various special cases.

Often the more work that is spent optimizing a server, the more these paths proliferate. Examples of such paths might be fast code to handle the case of a single clipping rectangle, drawing on aligned word boundaries, and blits for fast drawing of circles of small radii. It becomes difficult to test that a particular path remains correct because clients used to test server correctness are generally ignorant of the internal server implementation. For this reason, it is quite difficult to ensure testing coverage of all paths through server algorithms.

The XYZ extension can be used to remedy this situation. By carefully placing XYZ macros down each path of the algorithm to be tested, a client using XYZ can query the server to check what paths through the algorithm are being hit.

Realize such testing does require the test (or at least the tester) to be aware of what tag names are in the server. Careful construction of internals aware tests can ensure testing really exercises critical server algorithms.

In the glyph caching example cited earlier, testing using XYZ verified that rare conditions were indeed being executed correctly.