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_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_unlink_ENOTDIR.o test_yaffs_unlink_ENOENT2.o test_yaffs_unlink_ELOOP_dir.o test_yaffs_unlink_EROFS.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_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o \
+ test_yaffs_truncate_ELOOP_dir.o test_yaffs_truncate_EROFS.o \
+ test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o test_yaffs_write_EROFS.o \
test_yaffs_read.o test_yaffs_read_EBADF.o test_yaffs_read_EINVAL.o\
test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_big_file.o \
test_yaffs_access.o test_yaffs_access_EINVAL.o test_yaffs_access_ENOTDIR.o test_yaffs_access_ENOENT.o \
test_yaffs_mkdir_ELOOP_dir.o test_yaffs_mkdir_EROFS.o \
test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o \
test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o test_yaffs_symlink_EEXIST.o test_yaffs_symlink_ENOENT.o \
- test_yaffs_symlink_ENOENT2.o test_yaffs_symlink_ELOOP_dir.o \
+ test_yaffs_symlink_ENOENT2.o test_yaffs_symlink_ELOOP_dir.o test_yaffs_symlink_EROFS.o \
test_yaffs_mount2.o test_yaffs_mount2_ENODEV.o \
test_yaffs_unmount2.o test_yaffs_unmount2_ENODEV.o test_yaffs_unmount2_EINVAL.o \
test_yaffs_unmount2_with_handle_open_and_forced_mode_on.o test_yaffs_unmount2_with_handle_open_and_forced_mode_off.o\
- test_yaffs_sync.o test_yaffs_sync_ENODEV.o \
+ test_yaffs_sync.o test_yaffs_sync_ENODEV.o test_yaffs_sync_EROFS.o \
test_yaffs_remount_force_off_read_only_off.o test_yaffs_remount_force_on_read_only_off.o test_yaffs_remount_ENODEV.o \
test_yaffs_remount_EINVAL.o \
test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o \
test_yaffs_link_ENOTDIR2.o test_yaffs_link_ENOENT2.o test_yaffs_link_ENOENT3.o test_yaffs_link_ENOENT3.o \
test_yaffs_link_ENOENT4.o test_yaffs_link_ELOOP_dir.o test_yaffs_link_EROFS.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_ENOTDIR.o test_yaffs_rmdir_ELOOP_dir.o test_yaffs_rmdir_EROFS.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_file_to_dir.o test_yaffs_rename_EEXISTS.o test_yaffs_rename_ELOOP_dir.o test_yaffs_rename_EROFS.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_EROFS.o
#include "test_yaffs_unlink_ENOENT.h"
#include "test_yaffs_unlink_ENOENT2.h"
#include "test_yaffs_unlink_ELOOP_dir.h"
+#include "test_yaffs_unlink_EROFS.h"
#include "test_yaffs_ftruncate.h"
#include "test_yaffs_ftruncate_EBADF.h"
#include "test_yaffs_truncate_ENOENT2.h"
#include "test_yaffs_truncate_ELOOP.h"
#include "test_yaffs_truncate_ELOOP_dir.h"
+#include "test_yaffs_truncate_EROFS.h"
#include "test_yaffs_write.h"
#include "test_yaffs_write_EBADF.h"
#include "test_yaffs_write_big_file.h"
+#include "test_yaffs_write_EROFS.h"
#include "test_yaffs_read.h"
#include "test_yaffs_read_EBADF.h"
#include "test_yaffs_symlink_ENOENT.h"
#include "test_yaffs_symlink_ENOENT2.h"
#include "test_yaffs_symlink_ELOOP_dir.h"
+#include "test_yaffs_symlink_EROFS.h"
#include "test_yaffs_mount2.h"
#include "test_yaffs_mount2_ENODEV.h"
#include "test_yaffs_sync.h"
#include "test_yaffs_sync_ENODEV.h"
+#include "test_yaffs_sync_EROFS.h"
#include "test_yaffs_remount_force_off_read_only_off.h"
#include "test_yaffs_remount_force_on_read_only_off.h"
#include "test_yaffs_rmdir_ENOENT.h"
#include "test_yaffs_rmdir_ENOTDIR.h"
#include "test_yaffs_rmdir_ELOOP_dir.h"
+#include "test_yaffs_rmdir_EROFS.h"
#include "test_yaffs_rename.h"
#include "test_yaffs_rename_ENOENT.h"
#include "test_yaffs_rename_file_to_dir.h"
#include "test_yaffs_rename_EEXISTS.h"
#include "test_yaffs_rename_ELOOP_dir.h"
+#include "test_yaffs_rename_EROFS.h"
#include "test_yaffs_lstat.h"
#include "test_yaffs_lstat_ENOENT.h"
{test_yaffs_unlink_ENOENT,test_yaffs_unlink_ENOENT_clean,"test_yaffs_unlink_ENOENT"},
{test_yaffs_unlink_ENOENT2,test_yaffs_unlink_ENOENT2_clean,"test_yaffs_unlink_ENOENT2"},
{test_yaffs_unlink_ELOOP_dir,test_yaffs_unlink_ELOOP_dir_clean,"test_yaffs_unlink_ELOOP_dir"},
+ {test_yaffs_unlink_EROFS,test_yaffs_unlink_EROFS_clean,"test_yaffs_unlink_EROFS"},
{test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
{test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
{test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"},
{test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"},
+ {test_yaffs_write_EROFS,test_yaffs_write_EROFS_clean,"test_yaffs_write_EROFS"},
{test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
{test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"},
{test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"},
{test_yaffs_truncate_ENOENT2,test_yaffs_truncate_ENOENT2_clean,"test_yaffs_truncate_ENOENT2"},
{test_yaffs_truncate_ELOOP,test_yaffs_truncate_ELOOP_clean,"test_yaffs_truncate_ELOOP"},
+ {test_yaffs_truncate_EROFS,test_yaffs_truncate_EROFS_clean,"test_yaffs_truncate_EROFS"},
// {test_yaffs_truncate_big_file,test_yaffs_truncate_big_file_clean,"test_yaffs_truncate_big_file"}, //this test does not work because the large number becomes 0 when the file is compiled.
{test_yaffs_chmod,test_yaffs_chmod_clean,"test_yaffs_chmod"},
{test_yaffs_mkdir_ENOENT,test_yaffs_mkdir_ENOENT_clean,"test_yaffs_mkdir_ENOENT"},
{test_yaffs_mkdir_ELOOP_dir,test_yaffs_mkdir_ELOOP_dir_clean,"test_yaffs_mkdir_ELOOP_dir"},
{test_yaffs_mkdir_EROFS,test_yaffs_mkdir_EROFS_clean,"test_yaffs_mkdir_EROFS"},
+ {test_yaffs_rename_EROFS,test_yaffs_rename_EROFS_clean,"test_yaffs_rename_EROFS"},
{test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"},
{test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"},
{test_yaffs_symlink_ENOENT,test_yaffs_symlink_ENOENT_clean,"test_yaffs_symlink_ENOENT"},
{test_yaffs_symlink_ENOENT2,test_yaffs_symlink_ENOENT2_clean,"test_yaffs_symlink_ENOENT2"},
{test_yaffs_symlink_ELOOP_dir,test_yaffs_symlink_ELOOP_dir_clean,"test_yaffs_symlink_ELOOP_dir"},
+ {test_yaffs_symlink_EROFS,test_yaffs_symlink_EROFS_clean,"test_yaffs_symlink_EROFS"},
{test_yaffs_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
{test_yaffs_mount2_ENODEV,test_yaffs_mount2_ENODEV_clean,"test_yaffs_mount2_ENODEV"},
{test_yaffs_sync,test_yaffs_sync_clean,"test_yaffs_sync"},
{test_yaffs_sync_ENODEV,test_yaffs_sync_ENODEV_clean,"test_yaffs_sync_ENODEV"},
-
+ {test_yaffs_sync_EROFS,test_yaffs_sync_EROFS_clean,"test_yaffs_sync_EROFS"},
{test_yaffs_remount_force_off_read_only_off,test_yaffs_remount_force_off_read_only_off_clean,"test_yaffs_remount_force_off_read_only_off"},
{test_yaffs_rmdir_ENOENT,test_yaffs_rmdir_ENOENT_clean,"test_yaffs_rmdir_ENOENT"},
{test_yaffs_rmdir_ENOTDIR,test_yaffs_rmdir_ENOTDIR_clean,"test_yaffs_rmdir_ENOTDIR"},
{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_stat_ELOOP_dir,test_yaffs_stat_ELOOP_dir_clean,"test_yaffs_stat_ELOOP_dir"},
{test_yaffs_rename,test_yaffs_rename_clean,"test_yaffs_rename"},
if (EROFS_setup() < 0 ){
return -1;
}
- handle = test_yaffs_open();
-
- if (handle < 0){
+ handle = yaffs_open(FILE_PATH,O_CREAT ,S_IREAD );
+ if (handle<0){
print_message("failed to open file\n",2);
return -1;
}
+
+
output = yaffs_fchmod(handle,S_IREAD|S_IWRITE);
if (output<0){
int output = 0;
int error_code = 0;
EROFS_setup();
- handle = test_yaffs_open();
+ handle = yaffs_open(FILE_PATH,O_CREAT ,S_IREAD );
+ if (handle<0){
+ print_message("failed to open file\n",2);
+ return -1;
+ }
output = yaffs_fdatasync(handle);
if (output==-1){
error_code=yaffs_get_error();
int output=0;
int error =0;
EROFS_setup();
- handle = test_yaffs_open();
+ handle = yaffs_open(FILE_PATH,O_CREAT ,S_IREAD );
+ if (handle<0){
+ print_message("failed to open file\n",2);
+ return -1;
+ }
output = yaffs_flush(handle);
if (output<0){
error=yaffs_get_error();
int error_code = 0;
EROFS_setup();
- handle = test_yaffs_open();
+ handle = yaffs_open(FILE_PATH,O_CREAT ,S_IREAD );
+ if (handle<0){
+ print_message("failed to open file\n",2);
+ return -1;
+ }
output = yaffs_fsync(handle);
if (output==-1){
error_code=yaffs_get_error();
int output = 0;
int error_code = 0;
EROFS_setup();
- handle = test_yaffs_open();
-
+ handle = yaffs_open(FILE_PATH,O_CREAT ,S_IREAD );
+ if (handle<0){
+ print_message("failed to open file\n",2);
+ return -1;
+ }
output = yaffs_ftruncate(handle,FILE_SIZE_TRUNCATED );
if (output < 0){
error_code=yaffs_get_error();
yaffs_unlink(FILE_PATH);
EROFS_setup();
- handle = yaffs_open(FILE_PATH, O_CREAT | O_EXCL | O_TRUNC| O_RDWR ,FILE_MODE );
+ handle = yaffs_open(FILE_PATH, O_CREAT ,S_IREAD);
if (handle == -1){
error_code = yaffs_get_error();
if (abs(error_code) == EROFS){
--- /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_rename_EROFS.h"
+
+
+int test_yaffs_rename_EROFS(void)
+{
+ int output=0;
+ int error_code =0;
+ EROFS_setup();
+ output = yaffs_rename(FILE_PATH , RENAME_PATH);
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EROFS){
+ 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_rename_EROFS_clean(void)
+{
+ int output = 0;
+ if (0 == yaffs_access("/yaffs2/dir2/file",0) ) {
+ output = yaffs_unlink("/yaffs2/dir2/file");
+ if (output < 0) {
+ print_message("failed to remove the file\n",2);
+ return -1;
+ }
+ }
+ if (0 == yaffs_access(RENAME_PATH,0) && 0 != yaffs_access(DIR_PATH,0)) {
+ output = yaffs_rename(RENAME_PATH,FILE_PATH);
+ if (output < 0) {
+ print_message("failed to remove the directory\n",2);
+ return -1;
+ }
+ }
+
+ return EROFS_clean();
+
+}
+
--- /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_rename_EROFS_h__
+#define __test_yaffs_rename_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rename_EROFS(void);
+int test_yaffs_rename_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_rmdir_EROFS.h"
+
+
+int test_yaffs_rmdir_EROFS(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;
+ }
+ }
+
+ EROFS_setup();
+
+ output = yaffs_rmdir(DIR_PATH);
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EROFS){
+ 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_EROFS_clean(void)
+{
+ int output = 0;
+ int output2 =EROFS_clean();
+ if (0 == yaffs_access(DIR_PATH,0)) {
+ output = yaffs_rmdir(DIR_PATH);
+ if (output < 0) {
+ print_message("failed to remove the directory\n",2);
+ return -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_EROFS_h__
+#define __test_yaffs_rmdir_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rmdir_EROFS(void);
+int test_yaffs_rmdir_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_symlink_EROFS.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_EROFS(void)
+{
+ int error_code = 0;
+ if (-1==yaffs_access(SYMLINK_PATH,0)){
+ output=yaffs_symlink(FILE_PATH,SYMLINK_PATH);
+ if (output>0){
+ print_message("failed to create the first symlink\n",2);
+ return -1;
+ }
+ }
+ EROFS_setup();
+ output = yaffs_symlink(FILE_PATH,SYMLINK_PATH);
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EROFS){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a symlink over an existing symlink (which is a bad thing)\n",2);
+ return -1;
+ }
+
+}
+
+int test_yaffs_symlink_EROFS_clean(void)
+{
+ return EROFS_clean() && yaffs_unlink(SYMLINK_PATH);
+}
+
+
+
--- /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_symlink_EROFS_h__
+#define __test_yaffs_symlink_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_EROFS(void);
+int test_yaffs_symlink_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_sync_EROFS.h"
+
+
+int test_yaffs_sync_EROFS(void)
+{
+ int error_code=-1;
+ int output=0;
+
+ EROFS_setup();
+
+ output = yaffs_sync(YAFFS_MOUNT_POINT);
+
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EROFS){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else {
+ print_message("synced a file in a non-existing directory (which is a bad thing)\n",2);
+ return -1;
+ }
+
+
+}
+
+
+int test_yaffs_sync_EROFS_clean(void)
+{
+ return EROFS_clean();
+}
+
--- /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_sync_EROFS_h__
+#define __test_yaffs_sync_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_sync_EROFS(void);
+int test_yaffs_sync_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_truncate_EROFS.h"
+
+
+
+int test_yaffs_truncate_EROFS(void)
+{
+ int error=0;
+ int output=0;
+
+
+ EROFS_setup();
+ output= yaffs_truncate(FILE_PATH,FILE_SIZE_TRUNCATED );
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EROFS){
+ return 1;
+ } else {
+ print_message("received a different error than expected\n",2);
+ return -1;
+ }
+ } else{
+ print_message("truncated a file with EROFS\n",2);
+ return -1;
+ }
+}
+
+int test_yaffs_truncate_EROFS_clean(void)
+{
+ return EROFS_clean();
+}
--- /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_truncate_EROFS_h__
+#define __test_yaffs_truncate_EROFS_h__
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+int test_yaffs_truncate_EROFS(void);
+int test_yaffs_truncate_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_open_EROFS.h"
+
+
+int test_yaffs_unlink_EROFS(void)
+{
+ int output=0;
+ int error_code=0;
+
+ EROFS_setup();
+
+ output=yaffs_unlink(FILE_PATH);
+ 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("unlinked a directory with EROFS set.(which is a bad thing)\n",2);
+ return -1;
+ }
+
+
+}
+int test_yaffs_unlink_EROFS_clean(void)
+{
+ return EROFS_clean();
+}
+
--- /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_unlink_EROFS_dir_h__
+#define __test_yaffs_unlink_EROFS_dir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_unlink_EROFS(void);
+int test_yaffs_unlink_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_write_EROFS.h"
+
+static int handle= -1;
+
+int test_yaffs_write_EROFS(void)
+{
+ int output=0;
+ int error_code=0;
+ EROFS_setup();
+ handle=yaffs_open(FILE_PATH, O_CREAT ,S_IREAD);
+ if (handle>=0){
+ output= yaffs_write(handle, FILE_TEXT, FILE_TEXT_NBYTES);
+ if (output<0){
+ error_code=yaffs_get_error();
+ //printf("EISDIR def %d, Error code %d\n", ENOTDIR,error_code);
+ if (abs(error_code)==EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("wrote to a bad handle.(which is a bad thing)\n",2);
+ return -1;
+ }
+
+ } else {
+ print_message("error opening file\n",2);
+ return -1;
+ }
+}
+
+int test_yaffs_write_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_write_EROFS_h__
+#define __test_yaffs_write_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_write_EROFS(void);
+int test_yaffs_write_EROFS_clean(void);
+
+#endif