test_yaffs_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o \
test_yaffs_unlink_ENOTDIR.o test_yaffs_unlink_ENOENT2.o test_yaffs_unlink_ELOOP_dir.o \
test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_big_file.o \
+ test_yaffs_ftruncate_EROFS.o \
test_yaffs_truncate.o test_yaffs_truncate_ENOTDIR.o test_yaffs_truncate_EISDIR.o test_yaffs_truncate_ENOENT.o \
test_yaffs_truncate_EINVAL.o test_yaffs_truncate_big_file.o test_yaffs_truncate_ENOENT2.o test_yaffs_truncate_ELOOP.o \
test_yaffs_truncate_ELOOP_dir.o \
test_yaffs_access_ENOENT2.o test_yaffs_access_ELOOP_dir.o test_yaffs_access_ELOOP.o test_yaffs_access_EROFS.o \
test_yaffs_stat.o test_yaffs_stat_ENOENT.o test_yaffs_stat_ENOTDIR.o test_yaffs_stat_ENOENT2.o test_yaffs_stat_ELOOP.o \
test_yaffs_stat_ELOOP_dir.o\
- test_yaffs_fstat.o test_yaffs_fstat_EBADF.o \
+ test_yaffs_fstat.o test_yaffs_fstat_EBADF.o test_yaffs_fstat_EROFS.o \
test_yaffs_close_EBADF.o\
test_yaffs_chmod.o test_yaffs_chmod_ENOENT.o test_yaffs_chmod_ENOTDIR.o test_yaffs_chmod_EINVAL.o \
test_yaffs_chmod_ENOENT2.o test_yaffs_chmod_ELOOP_dir.o test_yaffs_chmod_ELOOP.o test_yaffs_chmod_EROFS.o \
test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EROFS.o test_yaffs_fchmod_EINVAL.o\
test_yaffs_fsync.o test_yaffs_fsync_EBADF.o \
- test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \
+ test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o test_yaffs_fdatasync_EROFS.o\
test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o test_yaffs_mkdir_ENOENT.o \
test_yaffs_mkdir_ELOOP_dir.o \
test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_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_lstat.o test_yaffs_lstat_ENOENT.o test_yaffs_lstat_ENOTDIR.o \
- test_yaffs_flush.o test_yaffs_flush_EBADF.o
+ test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o
#include "test_yaffs_ftruncate_EBADF.h"
#include "test_yaffs_ftruncate_EINVAL.h"
#include "test_yaffs_ftruncate_big_file.h"
+#include "test_yaffs_ftruncate_EROFS.h"
#include "test_yaffs_truncate.h"
#include "test_yaffs_fstat.h"
#include "test_yaffs_fstat_EBADF.h"
+#include "test_yaffs_fstat_EROFS.h"
#include "test_yaffs_chmod.h"
#include "test_yaffs_chmod_ENOENT.h"
#include "test_yaffs_fdatasync.h"
#include "test_yaffs_fdatasync_EBADF.h"
+#include "test_yaffs_fdatasync_EROFS.h"
#include "test_yaffs_mkdir.h"
#include "test_yaffs_mkdir_EEXIST.h"
#include "test_yaffs_flush.h"
#include "test_yaffs_flush_EBADF.h"
+#include "test_yaffs_flush_EROFS.h"
#include "yaffsfs.h"
#include "yaffs_error_converter.h"
{test_yaffs_fstat,test_yaffs_fstat_clean,"test_yaffs_fstat"},
{test_yaffs_fstat_EBADF,test_yaffs_fstat_EBADF_clean,"test_yaffs_fstat_EBADF"},
+ {test_yaffs_fstat_EROFS,test_yaffs_fstat_EROFS_clean,"test_yaffs_fstat_EROFS"},
{test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"},
{test_yaffs_ftruncate_EBADF,test_yaffs_ftruncate_EBADF_clean,"test_yaffs_ftruncate_EBADF"},
{test_yaffs_ftruncate_EINVAL,test_yaffs_ftruncate_EINVAL_clean,"test_yaffs_ftruncate_EINVAL"},
{test_yaffs_ftruncate_big_file,test_yaffs_ftruncate_big_file_clean,"test_yaffs_ftruncate_big_file"},
+ {test_yaffs_ftruncate_EROFS,test_yaffs_ftruncate_EROFS_clean,"test_yaffs_ftruncate_EROFS"},
{test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"},
{test_yaffs_truncate_ENOTDIR,test_yaffs_truncate_ENOTDIR_clean,"test_yaffs_truncate_ENOTDIR"},
{test_yaffs_fdatasync,test_yaffs_fdatasync_clean,"test_yaffs_fdatasync"},
{test_yaffs_fdatasync_EBADF,test_yaffs_fdatasync_EBADF_clean,"test_yaffs_fdatasync_EBADF"},
+ {test_yaffs_fdatasync_EROFS,test_yaffs_fdatasync_EROFS_clean,"test_yaffs_fdatasync_EROFS"},
{test_yaffs_mkdir,test_yaffs_mkdir_clean,"test_yaffs_mkdir"},
{test_yaffs_mkdir_EEXIST,test_yaffs_mkdir_EEXIST_clean,"test_yaffs_mkdir_EEXIST"},
{test_yaffs_unmount2,test_yaffs_unmount2_clean,"test_yaffs_unmount2"},
{test_yaffs_unmount2_ENODEV,test_yaffs_unmount2_ENODEV_clean,"test_yaffs_unmount2_ENODEV"},
- {test_yaffs_unmount2_EINVAL,test_yaffs_unmount2_EINVAL_clean,"test_yaffs_unmount2_EINVAL"}, {test_yaffs_unmount2_with_handle_open_and_forced_mode_on,test_yaffs_unmount2_with_handle_open_and_forced_mode_on_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_on"},
+ {test_yaffs_unmount2_EINVAL,test_yaffs_unmount2_EINVAL_clean,"test_yaffs_unmount2_EINVAL"},
+{test_yaffs_unmount2_with_handle_open_and_forced_mode_on,test_yaffs_unmount2_with_handle_open_and_forced_mode_on_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_on"},
{test_yaffs_unmount2_with_handle_open_and_forced_mode_off,test_yaffs_unmount2_with_handle_open_and_forced_mode_off_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_off"},
{test_yaffs_sync,test_yaffs_sync_clean,"test_yaffs_sync"},
{test_yaffs_lstat_ENOTDIR,test_yaffs_lstat_ENOTDIR_clean,"test_yaffs_lstat_ENOTDIR"},
{test_yaffs_flush,test_yaffs_flush_clean,"test_yaffs_flush"},
- {test_yaffs_flush_EBADF,test_yaffs_flush_EBADF_clean,"test_yaffs_flush_EBADF"}
+ {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"}
};
* published by the Free Software Foundation.
*/
-#include "test_yaffs_fdatasync.h"
+#include "test_yaffs_fdatasync_EBADF.h"
--- /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_fdatasync_EROFS.h"
+
+static int handle =-1;
+
+int test_yaffs_fdatasync_EROFS(void)
+{
+ int output = 0;
+ int error_code = 0;
+ EROFS_setup();
+ handle = test_yaffs_open();
+ output = yaffs_fdatasync(handle);
+ if (output==-1){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("file synced on a read only system.(which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_fdatasync_EROFS_clean(void)
+{
+ int output=1;
+ if (handle >= 0) {
+ output= yaffs_close(handle);
+ }
+ return (EROFS_clean() && output);
+}
+
--- /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_fdatasync_EROFS_h__
+#define __test_yaffs_fdatasync_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_fdatasync_EROFS(void);
+int test_yaffs_fdatasync_EROFS_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_flush_EROFS.h"
+
+static int handle =-1;
+
+int test_yaffs_flush_EROFS(void)
+{
+ int output=0;
+ int error =0;
+ EROFS_setup();
+ handle = test_yaffs_open();
+ output = yaffs_flush(handle);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("flushed a file with EROFS (which is a bad thing)\n",2);
+ return -1;
+ }
+
+}
+
+
+int test_yaffs_flush_EROFS_clean(void)
+{
+ int output=1;
+ if (handle >= 0) {
+ output= yaffs_close(handle);
+ }
+ return (EROFS_clean() && output);
+}
+
--- /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_flush_EROFS_h__
+#define __test_yaffs_flush_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_flush_EROFS(void);
+int test_yaffs_flush_EROFS_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_fstat_EROFS.h"
+
+static int handle = -1;
+
+int test_yaffs_fstat_EROFS(void)
+{
+ int output = 0;
+ struct yaffs_stat stat;
+ int error_code = 0;
+ EROFS_setup();
+ handle = test_yaffs_open();
+ output = yaffs_fstat(handle , &stat);
+ if (output < 0){
+ error_code = yaffs_get_error();
+ if (abs(error_code) == EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n", 2);
+ return -1;
+ }
+ } else {
+ print_message("file statted with EROFS set.(which is a bad thing)\n", 2 );
+ return -1;
+ }
+}
+
+int test_yaffs_fstat_EROFS_clean(void)
+{
+ int output=1;
+ if (handle >= 0) {
+ output= yaffs_close(handle);
+ }
+ return (EROFS_clean() && output);
+}
--- /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_fstat_EROFS_h__
+#define __test_yaffs_fstat_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_fstat_EROFS(void);
+int test_yaffs_fstat_EROFS_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_ftruncate_EROFS.h"
+
+static int handle = -1;
+
+int test_yaffs_ftruncate_EROFS(void)
+{
+ int output = 0;
+ int error_code = 0;
+ EROFS_setup();
+ handle = test_yaffs_open();
+
+ output = yaffs_ftruncate(handle,FILE_SIZE_TRUNCATED );
+ if (output < 0){
+ error_code=yaffs_get_error();
+ //printf("EISDIR def %d, Error code %d\n", EISDIR,error_code);
+ if (abs(error_code) == EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n", 2);
+ return -1;
+ }
+ } else {
+ print_message("file truncated with EROFS set.(which is a bad thing)\n", 2);
+ return -1;
+ }
+}
+
+int test_yaffs_ftruncate_EROFS_clean(void)
+{
+ int output=1;
+ if (handle >= 0) {
+ output= yaffs_close(handle);
+ }
+ return (EROFS_clean() && output);
+}
--- /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_ftruncate_EROFS_h__
+#define __test_yaffs_ftruncate_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_ftruncate_EROFS(void);
+int test_yaffs_ftruncate_EROFS_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_link_ELOOP_dir.h"
+
+
+
+int test_yaffs_link_ELOOP_dir(void)
+{
+ int output=0;
+ int error =0;
+
+ if (set_up_ELOOP()<0){
+ print_message("failed to setup symlinks\n",2);
+ return -1;
+ }
+
+ output = yaffs_link(ELOOP_PATH "/file",HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ELOOP){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a hard link to a non-existing-dir (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_link_ELOOP_dir_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ return 1; /* the file failed to open so there is no need to close it */
+ }
+}
+
--- /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_link_ELOOP_dir_h__
+#define __test_yaffs_link_ELOOP_dir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ELOOP_dir(void);
+int test_yaffs_link_ELOOP_dir_clean(void);
+
+#endif