usage of test function in loop should be avoided
Merge pull request #12 from Eleme/avoid_test_function_in_loop

optimize