select test read-write do-while loop