Add some tests for the failure cases of check_state and check_close.