improve starmath test code

Change-Id: Ife7e1306ce65dc1d935181553803fbc9266b628c