test fclose-loop