If it's intended only for testing, better move it to the test. I think randomPixmap and randomPolys should also be moved there, since it's unlikely we use it a normal circumstances.