gfxutil: fix state sorting tests