tests: call srand() before running test func.