fix test : the condition in the while loop is not right.
Merge pull request #1458 from gaohoward/master

fix test : the condition in the while loop is not right.