usage of rand and srand func, including function test