test_yaffs_link_ENAMETOOLONG2.o test_yaffs_link_NULL.o test_yaffs_link_NULL2.o \
test_yaffs_rmdir.o test_yaffs_rmdir_EBUSY.o test_yaffs_rmdir_EINVAL.o test_yaffs_rmdir_ENOENT.o \
test_yaffs_rmdir_ENOTDIR.o test_yaffs_rmdir_ELOOP_dir.o test_yaffs_rmdir_EROFS.o test_yaffs_rmdir_ENAMETOOLONG.o \
+ test_yaffs_rmdir_ENOTEMPTY.o \
test_yaffs_rename.o test_yaffs_rename_ENOENT.o test_yaffs_rename_ENOTDIR.o test_yaffs_rename_EINVAL.o \
test_yaffs_rename_dir.o test_yaffs_rename_dir_ENOENT.o test_yaffs_rename_dir_ENOENT2.o test_yaffs_rename_dir_to_file.o \
test_yaffs_rename_file_to_dir.o test_yaffs_rename_EEXISTS.o test_yaffs_rename_ELOOP_dir.o test_yaffs_rename_EROFS.o \
test_yaffs_rename_ENAMETOOLONG.o test_yaffs_rename_ENAMETOOLONG2.o test_yaffs_rename_NULL.o test_yaffs_rename_NULL2.o \
test_yaffs_lstat.o test_yaffs_lstat_ENOENT.o test_yaffs_lstat_ENOTDIR.o test_yaffs_lstat_ENAMETOOLONG.o \
test_yaffs_lstat_NULL.o \
- test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o
+ test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o \
+ test_yaffs_dup.o test_yaffs_dup_EBADF.o
test_yaffs_close_EBADF.c
test_yaffs_close_NULL.c
+test_yaffs_dup.c
+test_yaffs_dup_EBADF.c
+
test_yaffs_fchmod.c
test_yaffs_fchmod_EBADF.c
test_yaffs_fchmod_EINVAL.c
test_yaffs_readlink_ENOTDIR
test_yaffs_readlink_ELOOP
-
test_yaffs_mount2_with read only set
-
-
test_yaffs_remount_force_off_read_only_on
test_yaffs_remount_force_on_read_only_on
test_yaffs_closedir
-
test_yaffs_link_EPERM
test_yaffs_rmdir_ENOTEMPTY
test_yaffs_rename_EMLINK
- test_yaffs_rename_EEXISTS or EPERM
-
- test_yaffs_dup
- test_yaffs_dup_EBADF
+ test_yaffs_rename_EEXISTS or EPERM
test_yaffs_open_ENOSPC
test yaffs_open_running_out_of_handles error
-
-
test_yaffs_read_big_file
test what happens if you read off the end of the file?
test_yaffs_write_EINVAL
What happens when you run out of space?
- test_yaffs_write_EBADF
- test_yaffs_write
+
test_yaffs_pwrite_big_file
test_yaffs_pwrite_EINVAL
test_yaffs_unlink_ENOMEM
-
test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
-
Add a truncate function for truncating a file size to -1.
What happens if a handle is opened to a file and the file is then deleted?
Current BUGS
- Bug with test_yaffs_rename_dir it does not return an error code.
-
- Bug with test_yaffs_rename_EEXIST should be giving the bug EEXIST but instead gives ENOENT.
+
Current WARNINGS
#include "test_yaffs_rmdir_ELOOP_dir.h"
#include "test_yaffs_rmdir_EROFS.h"
#include "test_yaffs_rmdir_ENAMETOOLONG.h"
+#include "test_yaffs_rmdir_ENOTEMPTY.h"
#include "test_yaffs_rename.h"
#include "test_yaffs_rename_ENOENT.h"
#include "test_yaffs_flush_EBADF.h"
#include "test_yaffs_flush_EROFS.h"
+#include "test_yaffs_dup.h"
+#include "test_yaffs_dup_EBADF.h"
#include "yaffsfs.h"
#include "yaffs_error_converter.h"
{test_yaffs_rmdir_ELOOP_dir,test_yaffs_rmdir_ELOOP_dir_clean,"test_yaffs_rmdir_ELOOP_dir"},
{test_yaffs_rmdir_EROFS,test_yaffs_rmdir_EROFS_clean,"test_yaffs_rmdir_EROFS"},
{test_yaffs_rmdir_ENAMETOOLONG,test_yaffs_rmdir_ENAMETOOLONG_clean,"test_yaffs_rmdir_ENAMETOOLONG"},
+ {test_yaffs_rmdir_ENOTEMPTY,test_yaffs_rmdir_ENOTEMPTY_clean,"test_yaffs_rmdir_ENOTEMPTY"},
{test_yaffs_stat_ELOOP_dir,test_yaffs_stat_ELOOP_dir_clean,"test_yaffs_stat_ELOOP_dir"},
{test_yaffs_flush_EBADF,test_yaffs_flush_EBADF_clean,"test_yaffs_flush_EBADF"},
{test_yaffs_flush_EROFS,test_yaffs_flush_EROFS_clean,"test_yaffs_flush_EROFS"},
-
+ {test_yaffs_dup,test_yaffs_dup_clean,"test_yaffs_dup"},
+ {test_yaffs_dup_EBADF,test_yaffs_dup_EBADF_clean,"test_yaffs_dup_EBADF"},
};
--- /dev/null
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_dup.h"
+
+static int handle = -1;
+static int handle2 = -1;
+int test_yaffs_dup(void)
+{
+ handle = yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE);
+ if (handle >=0){
+ handle2 =yaffs_dup(handle);
+ return handle2;
+ }
+
+}
+
+
+int test_yaffs_dup_clean(void)
+{
+ int output1=1;
+ int output2=1;
+ if (handle >= 0){
+ output1= yaffs_close(handle);
+ }
+ if (handle2 >= 0){
+ output2 =yaffs_close(handle2);
+ }
+ return (output1 && output2);
+}
--- /dev/null
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_dup_h__
+#define __test_yaffs_dup_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_dup(void);
+int test_yaffs_dup_clean(void);
+
+#endif
--- /dev/null
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_dup_EBADF.h"
+
+
+int test_yaffs_dup_EBADF(void)
+{
+ int error_code= -1;
+ int output =yaffs_dup(-1);
+ if (output < 0){
+ error_code = yaffs_get_error();
+ if (abs(error_code) == EBADF){
+ return 1;
+ } else {
+ print_message("different error than expected\n", 2);
+ return -1;
+ }
+ } else {
+ print_message("non existant handle duplicated.(which is a bad thing)\n", 2 );
+ return -1;
+ }
+}
+
+
+int test_yaffs_dup_EBADF_clean(void)
+{
+ return 1;
+}
--- /dev/null
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_dup_EBADF_h__
+#define __test_yaffs_dup_EBADF_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_dup_EBADF(void);
+int test_yaffs_dup_EBADF_clean(void);
+
+#endif
--- /dev/null
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_rmdir_ENOTEMPTY.h"
+
+
+int test_yaffs_rmdir_ENOTEMPTY(void)
+{
+ int output=0;
+ int error_code =0;
+
+ if (0 != yaffs_access(DIR_PATH,0)) {
+ output = yaffs_mkdir(DIR_PATH,S_IWRITE | S_IREAD);
+ if (output < 0) {
+ print_message("failed to create directory\n",2);
+ return -1;
+ }
+ }
+ if (0 != yaffs_access("/yaffs2/new_directory/dir",0)) {
+ output = yaffs_mkdir("/yaffs2/new_directory/dir",S_IWRITE | S_IREAD);
+ if (output < 0) {
+ print_message("failed to create directory\n",2);
+ return -1;
+ }
+ }
+ output = yaffs_rmdir(DIR_PATH);
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==ENOTEMPTY){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else{
+ print_message("removed /yaffs2/ directory (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_rmdir_ENOTEMPTY_clean(void)
+{
+ int output = -1;
+ int output2 = -1;
+ if (0 == yaffs_access("/yaffs2/new_directory/dir",0)) {
+ output = yaffs_rmdir("/yaffs2/new_directory/dir");
+ if (output < 0) {
+ print_message("failed to remove the directory\n",2);
+ output=1;
+ }
+ }
+ if (0 == yaffs_access(DIR_PATH,0)) {
+ output = yaffs_rmdir(DIR_PATH);
+ if (output < 0) {
+ print_message("failed to remove the directory\n",2);
+ output2=1;
+ }
+ }
+ return (output && output2);
+
+}
+
--- /dev/null
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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_rmdir_ENOTEMPTY_h__
+#define __test_yaffs_rmdir_ENOTEMPTY_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rmdir_ENOTEMPTY(void);
+int test_yaffs_rmdir_ENOTEMPTY_clean(void);
+
+#endif