Add tests for function exit codes.