From 618878c65069562a2a5208b4cfe50591bba49e8d Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 25 Jun 2021 15:11:45 +1200 Subject: [PATCH] Removed old test from timothy_tests/quick_tests Linux now allows directories to be opened. When quick_tests were written, open was supposed to return the error code EISDIR. Signed-off-by: Timothy Manning --- .../timothy_tests/quick_tests/Makefile | 2 +- .../timothy_tests/quick_tests/quick_tests.h | 2 - .../quick_tests/test_yaffs_open_EISDIR.c | 46 ------------------- .../quick_tests/test_yaffs_open_EISDIR.h | 24 ---------- 4 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.c delete mode 100644 direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.h diff --git a/direct/test-framework/timothy_tests/quick_tests/Makefile b/direct/test-framework/timothy_tests/quick_tests/Makefile index 614ae39..b25f9c4 100644 --- a/direct/test-framework/timothy_tests/quick_tests/Makefile +++ b/direct/test-framework/timothy_tests/quick_tests/Makefile @@ -23,7 +23,7 @@ TESTFILES = quick_tests.o lib.o \ test_yaffs_mount.o test_yaffs_mount_ENODEV.o test_yaffs_mount_ENAMETOOLONG.o test_yaffs_mount_EBUSY.o \ test_yaffs_mount_NULL.o \ test_yaffs_unmount.o test_yaffs_unmount_ENODEV.o test_yaffs_unmount_ENAMETOOLONG.o test_yaffs_unmount_EBUSY.o \ - test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o \ + test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o \ test_yaffs_open_ENAMETOOLONG.o test_yaffs_open_EINVAL.o test_yaffs_open_EINVAL2.o test_yaffs_open_ELOOP.o \ test_yaffs_open_ELOOP_dir.o test_yaffs_open_EROFS.o test_yaffs_open_EACCES.o test_yaffs_open_NULL.o \ test_yaffs_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o \ diff --git a/direct/test-framework/timothy_tests/quick_tests/quick_tests.h b/direct/test-framework/timothy_tests/quick_tests/quick_tests.h index ce49d06..2586fa1 100644 --- a/direct/test-framework/timothy_tests/quick_tests/quick_tests.h +++ b/direct/test-framework/timothy_tests/quick_tests/quick_tests.h @@ -29,7 +29,6 @@ #include "test_yaffs_unmount_EBUSY.h" #include "test_yaffs_open.h" -#include "test_yaffs_open_EISDIR.h" #include "test_yaffs_open_EEXIST.h" #include "test_yaffs_open_ENOENT.h" #include "test_yaffs_open_ENOTDIR.h" @@ -286,7 +285,6 @@ test_template test_list[]={ {test_yaffs_unmount_EBUSY,test_yaffs_unmount_EBUSY_clean,"test_yaffs_unmount_EBUSY"}, {test_yaffs_open,test_yaffs_open_clean,"test_yaffs_open"}, - {test_yaffs_open_EISDIR,test_yaffs_open_EISDIR_clean,"test_yaffs_open_EISDIR"}, {test_yaffs_open_EEXIST,test_yaffs_open_EEXIST_clean,"test_yaffs_open_EEXIST"}, {test_yaffs_open_ENOTDIR,test_yaffs_open_ENOTDIR_clean,"test_yaffs_open_ENOTDIR"}, {test_yaffs_open_ENOENT,test_yaffs_open_ENOENT_clean,"test_yaffs_open_ENOENT"}, diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.c deleted file mode 100644 index 8ca3cea..0000000 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * YAFFS: Yet another FFS. A NAND-flash specific file system. - * - * Copyright (C) 2002-2018 Aleph One Ltd. - * - * Created by Timothy Manning - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include "test_yaffs_open_EISDIR.h" - -/*EISDIR is caused by trying to open a directory */ - -static int handle = -1; - -int test_yaffs_open_EISDIR(void) -{ - int error_code=0; - - handle=yaffs_open(YAFFS_MOUNT_POINT, O_CREAT | O_TRUNC| O_RDWR ,FILE_MODE ); - if (handle == -1){ - error_code=yaffs_get_error(); - if (abs(error_code)== EISDIR){ - return 1; - } else { - print_message("different error than expected\n", 2); - return -1; - } - } else { - print_message("non existant directory opened.(which is a bad thing)\n", 2); - return -1; - } - -} -int test_yaffs_open_EISDIR_clean(void) -{ - if (handle >=0){ - return yaffs_close(handle); - } else { - return 1; /* the file failed to open so there is no need to close it*/ - } -} - diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.h b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.h deleted file mode 100644 index 4282ae4..0000000 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_EISDIR.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * YAFFS: Yet another Flash File System . A NAND-flash specific file system. - * - * Copyright (C) 2002-2018 Aleph One Ltd. - * - * Created by Timothy Manning - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. - */ - -#ifndef __test_yaffs_open_EISDIR_h__ -#define __test_yaffs_open_EISDIR_h__ - -#include "lib.h" -#include "yaffsfs.h" - -int test_yaffs_open_EISDIR(void); -int test_yaffs_open_EISDIR_clean(void); - -#endif -- 2.30.2