Implement test_close in test.c