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_access_ENOENT2.o test_yaffs_access_ELOOP.o \
+ test_yaffs_access_ENOENT2.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_fstat.o test_yaffs_fstat_EBADF.o \
test_yaffs_close_EBADF.o\
test_yaffs_fdatasync.c
test_yaffs_fdatasync_EBADF.c
+test_yaffs_flush
+test_yaffs_flush_EBADF
+
test_yaffs_freespace.c
test_yaffs_freespace_EINVAL.c
test_yaffs_mkdir_EACCES
- test_yaffs_mkdir_ELOOP
test_yaffs_mkdir_ENAMETOOLONG
test_yaffs_mkdir_EROFS
test_yaffs_dup
test_yaffs_dup_EBADF
- test_yaffs_flush
- test_yaffs_flush_EBADF
-
test_yaffs_fchmod_EACCES
test_yaffs_fchmod_ELOOP
}
+int EROFS_setup(void)
+{
+ int output= -1;
+ output=yaffs_remount(YAFFS_MOUNT_POINT,1,1);
+ if (output<0){
+ print_message("failed to remount yaffs\n",2);
+ return -1;
+ }
+ return 1;
+}
+
+int EROFS_clean(void)
+{
+ int output=-1;
+ output= yaffs_remount(YAFFS_MOUNT_POINT,1,0);
+ if (output<0){
+ print_message("failed to remount yaffs\n",2);
+ return -1;
+ }
+ return 1;
+}
+
+
int set_up_ELOOP(void){
int output1=1;
int output2=1;
#include "yaffsfs.h"
-#define ELOOP 10 //the error code ELOOP is not defined yet so I'm making a stand in.
+
#define YAFFS_MOUNT_POINT "/yaffs2/"
void set_exit_on_error(int num);
int get_exit_on_error(void);
int set_up_ELOOP(void);
+int EROFS_setup(void);
+int EROFS_clean(void);
#endif
#include "test_yaffs_access_ENOENT.h"
#include "test_yaffs_access_ENOENT2.h"
#include "test_yaffs_access_ELOOP.h"
+#include "test_yaffs_access_EROFS.h"
#include "test_yaffs_stat.h"
#include "test_yaffs_stat_ENOENT.h"
#include "test_yaffs_chmod_EINVAL.h"
#include "test_yaffs_chmod_ENOENT2.h"
#include "test_yaffs_chmod_ELOOP.h"
+#include "test_yaffs_chmod_EROFS.h"
#include "test_yaffs_fchmod.h"
#include "test_yaffs_fchmod_EBADF.h"
{test_yaffs_access_ENOENT,test_yaffs_access_ENOENT_clean,"test_yaffs_access_ENOENT"},
{test_yaffs_access_ENOENT2,test_yaffs_access_ENOENT2_clean,"test_yaffs_access_ENOENT2"},
{test_yaffs_access_ELOOP,test_yaffs_access_ELOOP_clean,"test_yaffs_access_ELOOP"},
+ {test_yaffs_access_EROFS,test_yaffs_access_EROFS_clean,"test_yaffs_access_EROFS"},
{test_yaffs_unlink, test_yaffs_unlink_clean,"test_yaffs_unlink"},
{test_yaffs_unlink_EISDIR,test_yaffs_unlink_EISDIR_clean,"test_yaffs_unlink_EISDIR"},
{test_yaffs_chmod_ENOTDIR,test_yaffs_chmod_ENOTDIR_clean,"test_yaffs_chmod_ENOTDIR"},
{test_yaffs_chmod_EINVAL,test_yaffs_chmod_EINVAL_clean,"test_yaffs_chmod_EINVAL"},
{test_yaffs_chmod_ELOOP,test_yaffs_chmod_ELOOP_clean,"test_yaffs_chmod_ELOOP"},
+ {test_yaffs_chmod_EROFS,test_yaffs_chmod_EROFS_clean,"test_yaffs_chmod_EROFS"},
+
{test_yaffs_fchmod,test_yaffs_fchmod_clean,"test_yaffs_fchmod"},
{test_yaffs_fchmod_EBADF,test_yaffs_fchmod_EBADF_clean,"test_yaffs_fchmod_EBADF"},
{test_yaffs_fchmod_EINVAL,test_yaffs_fchmod_EINVAL_clean,"test_yaffs_fchmod_EINVAL"},
--- /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_access_EROFS.h"
+
+int test_yaffs_access_EROFS(void)
+{
+ int output=0;
+ int error=0;
+ if (EROFS_setup() < 0 ){
+ return -1;
+ }
+
+ output= yaffs_access(FILE_PATH,R_OK |W_OK);
+ if (output<0){
+ error=yaffs_get_error();
+ if ( abs(error)== EROFS){
+ return 1;
+ } else {
+ print_message("error does not match expected error\n",2);
+ return -1;
+ }
+ } else{
+ print_message("accessed an existing file with the file system mounted as read only (which is a bad thing)\n",2);
+
+ return -1;
+ }
+}
+
+int test_yaffs_access_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__access_EROFS_h__
+#define __test_yaffs_access_EROFS_h__
+#include "lib.h"
+#include "yaffsfs.h"
+int test_yaffs_access_EROFS(void);
+int test_yaffs_access_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_chmod_EROFS.h"
+
+int test_yaffs_chmod_EROFS(void)
+{
+ int error=0;
+ int output;
+
+ EROFS_setup();
+
+ output = yaffs_chmod(FILE_PATH,S_IREAD|S_IWRITE);
+
+ 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("chmoded with EROFS setup (which is a bad thing)\n",2);
+ return -1;
+ }
+
+}
+
+int test_yaffs_chmod_EROFS_clean(void)
+{
+ return test_yaffs_chmod() | 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_chmod_EROFS_h__
+#define __test_yaffs_chmod_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_chmod.h"
+
+int test_yaffs_chmod_EROFS(void);
+int test_yaffs_chmod_EROFS_clean(void);
+
+#endif