WPI: improve test code.