finish function test