2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Timothy Manning <timothy@yaffs.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 /* generates a EBADF error by closing a handle twice */
15 #include "test_yaffs_open.h"
17 static int handle = -1;
19 int test_yaffs_close_EBADF(void)
24 handle = test_yaffs_open();
26 output = yaffs_close(handle);
28 output = yaffs_close(handle);
30 error_code = yaffs_get_error();
31 if (abs(error_code) == EBADF){
35 print_message("different error than expected\n",2);
39 print_message("closed the same handle twice. (which is a bad thing)\n", 2);
43 print_message("failed to close the handle the firs time\n", 2);
47 print_message("failed to open file\n", 2);
54 int test_yaffs_close_EBADF_clean(void)
57 printf("handle %d\n",handle);
58 return yaffs_close(handle);