add the helper function for unit test
fix
minor fix
Merge pull request #2115 from yorkerlin/develop

a helper function for unit test