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_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_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_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_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_dir.o test_yaffs_access_ELOOP2.o test_yaffs_access_EROFS.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_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_ELOOP2.o test_yaffs_chmod_EROFS.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_fsync.o test_yaffs_fsync_EBADF.o \
test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \
test_yaffs_mkdir_ELOOP_dir.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_ENOENT2.o test_yaffs_symlink_ELOOP_dir.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_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_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_ENOTDIR.o test_yaffs_rmdir_ELOOP_dir.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.o test_yaffs_rename_ELOOP_dev.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
#include "test_yaffs_unlink_ENOTDIR.h"
#include "test_yaffs_unlink_ENOENT.h"
#include "test_yaffs_unlink_ENOENT2.h"
+#include "test_yaffs_unlink_ELOOP_dir.h"
#include "test_yaffs_ftruncate.h"
#include "test_yaffs_ftruncate_EBADF.h"
#include "test_yaffs_truncate_big_file.h"
#include "test_yaffs_truncate_ENOENT2.h"
#include "test_yaffs_truncate_ELOOP.h"
+#include "test_yaffs_truncate_ELOOP_dir.h"
#include "test_yaffs_write.h"
#include "test_yaffs_write_EBADF.h"
#include "test_yaffs_access_ENOENT.h"
#include "test_yaffs_access_ENOENT2.h"
#include "test_yaffs_access_ELOOP_dir.h"
-#include "test_yaffs_access_ELOOP2.h"
+#include "test_yaffs_access_ELOOP.h"
#include "test_yaffs_access_EROFS.h"
#include "test_yaffs_stat.h"
#include "test_yaffs_stat_ENOTDIR.h"
#include "test_yaffs_stat_ENOENT2.h"
#include "test_yaffs_stat_ELOOP.h"
+#include "test_yaffs_stat_ELOOP_dir.h"
#include "test_yaffs_fstat.h"
#include "test_yaffs_fstat_EBADF.h"
#include "test_yaffs_chmod_EINVAL.h"
#include "test_yaffs_chmod_ENOENT2.h"
#include "test_yaffs_chmod_ELOOP_dir.h"
-#include "test_yaffs_chmod_ELOOP2.h"
+#include "test_yaffs_chmod_ELOOP.h"
#include "test_yaffs_chmod_EROFS.h"
#include "test_yaffs_fchmod.h"
#include "test_yaffs_symlink_EEXIST.h"
#include "test_yaffs_symlink_ENOENT.h"
#include "test_yaffs_symlink_ENOENT2.h"
+#include "test_yaffs_symlink_ELOOP_dir.h"
#include "test_yaffs_mount2.h"
#include "test_yaffs_mount2_ENODEV.h"
#include "test_yaffs_rmdir_EINVAL.h"
#include "test_yaffs_rmdir_ENOENT.h"
#include "test_yaffs_rmdir_ENOTDIR.h"
+#include "test_yaffs_rmdir_ELOOP_dir.h"
#include "test_yaffs_rename.h"
#include "test_yaffs_rename_ENOENT.h"
#include "test_yaffs_rename_dir_to_file.h"
#include "test_yaffs_rename_file_to_dir.h"
#include "test_yaffs_rename_EEXISTS.h"
-#include "test_yaffs_rename_ELOOP.h"
-#include "test_yaffs_rename_ELOOP_dev.h"
+#include "test_yaffs_rename_ELOOP_dir.h"
#include "test_yaffs_lstat.h"
#include "test_yaffs_lstat_ENOENT.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_dir,test_yaffs_access_ELOOP_dir_clean,"test_yaffs_access_ELOOP_dir"},
- {test_yaffs_access_ELOOP2,test_yaffs_access_ELOOP2_clean,"test_yaffs_access_ELOOP2"},
+ {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_ENOTDIR,test_yaffs_unlink_ENOTDIR_clean,"test_yaffs_unlink_ENOTDIR"},
{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_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
{test_yaffs_stat_ENOTDIR,test_yaffs_stat_ENOTDIR_clean,"test_yaffs_stat_ENOTDIR"},
{test_yaffs_stat_ENOENT2,test_yaffs_stat_ENOENT2_clean,"test_yaffs_stat_ENOENT2"},
{test_yaffs_stat_ELOOP,test_yaffs_stat_ELOOP_clean,"test_yaffs_stat_ELOOP"},
+ {test_yaffs_truncate_ELOOP_dir,test_yaffs_truncate_ELOOP_dir_clean,"test_yaffs_truncate_ELOOP_dir"},
{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_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_dir,test_yaffs_chmod_ELOOP_dir_clean,"test_yaffs_chmod_ELOOP_dir"},
- {test_yaffs_chmod_ELOOP2,test_yaffs_chmod_ELOOP2_clean,"test_yaffs_chmod_ELOOP2"},
+ {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_symlink_EEXIST,test_yaffs_symlink_EEXIST_clean,"test_yaffs_symlink_EEXIST"},
{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_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
{test_yaffs_mount2_ENODEV,test_yaffs_mount2_ENODEV_clean,"test_yaffs_mount2_ENODEV"},
{test_yaffs_rmdir_EINVAL,test_yaffs_rmdir_EINVAL_clean,"test_yaffs_rmdir_EINVAL"},
{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_stat_ELOOP_dir,test_yaffs_stat_ELOOP_dir_clean,"test_yaffs_stat_ELOOP_dir"},
{test_yaffs_rename,test_yaffs_rename_clean,"test_yaffs_rename"},
{test_yaffs_rename_ENOENT,test_yaffs_rename_ENOENT_clean,"test_yaffs_rename_ENOENT"},
{test_yaffs_rename_dir,test_yaffs_rename_dir_clean,"test_yaffs_rename_dir"},
{test_yaffs_rename_dir_ENOENT,test_yaffs_rename_dir_ENOENT_clean,"test_yaffs_rename_dir_ENOENT"},
{test_yaffs_rename_dir_ENOENT2,test_yaffs_rename_dir_ENOENT2_clean,"test_yaffs_rename_dir_ENOENT2"},
- {test_yaffs_rename_dir_to_file,test_yaffs_rename_dir_to_file_clean,"test_yaffs_rename_dir_to_file"},
{test_yaffs_rename_file_to_dir,test_yaffs_rename_file_to_dir_clean,"test_yaffs_rename_file_to_dir"},
+ {test_yaffs_rename_dir_to_file,test_yaffs_rename_dir_to_file_clean,"test_yaffs_rename_dir_to_file"},
{test_yaffs_rename_EEXISTS,test_yaffs_rename_EEXISTS_clean,"test_yaffs_rename_EEXISTS"},
- {test_yaffs_rename_ELOOP,test_yaffs_rename_ELOOP_clean,"test_yaffs_rename_ELOOP"},
- {test_yaffs_rename_ELOOP_dev,test_yaffs_rename_ELOOP_dev_clean,"test_yaffs_rename_ELOOP_dev"},
+ {test_yaffs_rename_ELOOP_dir,test_yaffs_rename_ELOOP_dir_clean,"test_yaffs_rename_ELOOP_dir"},
{test_yaffs_lstat,test_yaffs_lstat_clean,"test_yaffs_lstat"},
{test_yaffs_lstat_ENOENT,test_yaffs_lstat_ENOENT_clean,"test_yaffs_lstat_ENOENT"},
* published by the Free Software Foundation.
*/
-#include "test_yaffs_access_ELOOP2.h"
+#include "test_yaffs_access_ELOOP.h"
-int test_yaffs_access_ELOOP2(void)
+int test_yaffs_access_ELOOP(void)
{
int output=0;
int error=0;
}
}
-int test_yaffs_access_ELOOP2_clean(void)
+int test_yaffs_access_ELOOP_clean(void)
{
return 1;
}
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_rename_ELOOP_h__
-#define __test_yaffs_rename_ELOOP_h__
-
+#ifndef __test_yaffs_access_ELOOP_h__
+#define __test_yaffs_access_ELOOP_h__
#include "lib.h"
#include "yaffsfs.h"
-
-int test_yaffs_rename_ELOOP(void);
-int test_yaffs_rename_ELOOP_clean(void);
-
+int test_yaffs_access_ELOOP(void);
+int test_yaffs_access_ELOOP_clean(void);
#endif
* published by the Free Software Foundation.
*/
-#include "test_yaffs_chmod_ELOOP2.h"
+#include "test_yaffs_chmod_ELOOP.h"
-int test_yaffs_chmod_ELOOP2(void)
+int test_yaffs_chmod_ELOOP(void)
{
int error=0;
int output;
}
-int test_yaffs_chmod_ELOOP2_clean(void)
+int test_yaffs_chmod_ELOOP_clean(void)
{
return test_yaffs_chmod();
}
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_chmod_ELOOP2_h__
-#define __test_yaffs_chmod_ELOOP2_h__
+#ifndef __test_yaffs_chmod_ELOOP_h__
+#define __test_yaffs_chmod_ELOOP_h__
#include "lib.h"
#include "yaffsfs.h"
#include "test_yaffs_chmod.h"
-int test_yaffs_chmod_ELOOP2(void);
-int test_yaffs_chmod_ELOOP2_clean(void);
+int test_yaffs_chmod_ELOOP(void);
+int test_yaffs_chmod_ELOOP_clean(void);
#endif
int test_yaffs_flush(void)
{
- int output=0;
+ int output=-1;
handle = test_yaffs_open();
- output =yaffs_flush(handle);
-
+ if (handle >= 0){
+ output =yaffs_flush(handle);
+ } else {
+ print_message("failed to open file\n",2);
+ }
+ return output;
}
int test_yaffs_flush_clean(void)
{
- return yaffs_close(handle);
+ if (handle>=0){
+ return yaffs_close(handle);
+ } else {
+ return -1;
+ }
}
* published by the Free Software Foundation.
*/
-#include "test_yaffs_rename_ELOOP_dev.h"
+#include "test_yaffs_rename_ELOOP_dir.h"
-int test_yaffs_rename_ELOOP_dev(void)
+int test_yaffs_rename_ELOOP_dir(void)
{
int output=0;
int error_code =0;
}
-int test_yaffs_rename_ELOOP_dev_clean(void)
+int test_yaffs_rename_ELOOP_dir_clean(void)
{
int output = 0;
if (0 == yaffs_access(RENAME_PATH,0)) {
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_rename_ELOOP_dev_h__
-#define __test_yaffs_rename_ELOOP_dev_h__
+#ifndef __test_yaffs_rename_ELOOP_dir_h__
+#define __test_yaffs_rename_ELOOP_dir_h__
#include "lib.h"
#include "yaffsfs.h"
-int test_yaffs_rename_ELOOP_dev(void);
-int test_yaffs_rename_ELOOP_dev_clean(void);
+int test_yaffs_rename_ELOOP_dir(void);
+int test_yaffs_rename_ELOOP_dir_clean(void);
#endif
* published by the Free Software Foundation.
*/
-#include "test_yaffs_rename_ELOOP.h"
+#include "test_yaffs_rmdir_ELOOP_dir.h"
-int test_yaffs_rename_ELOOP(void)
+int test_yaffs_rmdir_ELOOP_dir(void)
{
int output=0;
int error_code =0;
-
if (set_up_ELOOP()<0){
print_message("failed to setup symlinks\n",2);
return -1;
}
- output = yaffs_rename(ELOOP_PATH , RENAME_PATH);
+ 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;
+ }
+ }
+ output = yaffs_rmdir(ELOOP_PATH "/file");
if (output<0){
error_code=yaffs_get_error();
if (abs(error_code)==ELOOP){
return -1;
}
} else{
- print_message("renamed a ELOOP (which is a bad thing)\n",2);
+ print_message("removed /yaffs2/ directory (which is a bad thing)\n",2);
return -1;
}
}
-int test_yaffs_rename_ELOOP_clean(void)
+int test_yaffs_rmdir_ELOOP_dir_clean(void)
{
int output = 0;
- if (0 == yaffs_access(RENAME_PATH,0)) {
- output = yaffs_rename(RENAME_PATH,FILE_PATH);
+ 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;
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs__access_ELOOP2_h__
-#define __test_yaffs_access_ELOOP2_h__
+#ifndef __test_yaffs_rmdir_ELOOP_dir_h__
+#define __test_yaffs_rmdir_ELOOP_dir_h__
+
#include "lib.h"
#include "yaffsfs.h"
-int test_yaffs_access_ELOOP2(void);
-int test_yaffs_access_ELOOP2_clean(void);
+
+int test_yaffs_rmdir_ELOOP_dir(void);
+int test_yaffs_rmdir_ELOOP_dir_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_stat_ELOOP_dir.h"
+
+int test_yaffs_stat_ELOOP_dir(void)
+{
+ int error_code=0;
+ struct yaffs_stat stat;
+ int output=0;
+ char text[100];
+ text[0] ='\0';
+
+ if (set_up_ELOOP()<0){
+ print_message("failed to setup symlinks\n",2);
+ return -1;
+ }
+ output=yaffs_stat(ELOOP_PATH "/file", &stat);;
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==ELOOP){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else {
+ print_message("stated a ELOOP (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+int test_yaffs_stat_ELOOP_dir_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_stat_ELOOP_dir_h__
+#define __test_yaffs_stat_ELOOP_dir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_stat_ELOOP_dir(void);
+int test_yaffs_stat_ELOOP_dir_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_ELOOP_dir.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_ELOOP_dir(void)
+{
+ int error_code = 0;
+ if (set_up_ELOOP()<0){
+ print_message("failed to setup symlinks\n",2);
+ return -1;
+ }
+
+ output = yaffs_symlink(FILE_PATH,ELOOP_PATH "/file");
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==ELOOP){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a symlink in a non-existing directory (which is a bad thing)\n",2);
+ return -1;
+ }
+
+}
+
+int test_yaffs_symlink_ELOOP_dir_clean(void)
+{
+ if (output >= 0){
+ return yaffs_unlink(SYMLINK_PATH);
+ } 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_symlink_ELOOP_dir_h__
+#define __test_yaffs_symlink_ELOOP_dir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_ELOOP_dir(void);
+int test_yaffs_symlink_ELOOP_dir_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_ELOOP_dir.h"
+
+
+
+int test_yaffs_truncate_ELOOP_dir(void)
+{
+ int error=0;
+ int output=0;
+
+ if (set_up_ELOOP()<0){
+ print_message("failed to setup symlinks\n",2);
+ return -1;
+ }
+
+ output= yaffs_truncate(ELOOP_PATH "/file",FILE_SIZE_TRUNCATED );
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ELOOP){
+ return 1;
+ } else {
+ print_message("received a different error than expected\n",2);
+ return -1;
+ }
+ } else{
+ print_message("truncated a nonexisting file\n",2);
+ return -1;
+ }
+}
+
+int test_yaffs_truncate_ELOOP_dir_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_truncate_ELOOP_dir_h__
+#define __test_yaffs_truncate_ELOOP_dir_h__
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+int test_yaffs_truncate_ELOOP_dir(void);
+int test_yaffs_truncate_ELOOP_dir_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_ELOOP_dir.h"
+
+
+int test_yaffs_unlink_ELOOP_dir(void)
+{
+ int output=0;
+ int error_code=0;
+
+ if (set_up_ELOOP()<0){
+ print_message("failed to setup symlinks\n",2);
+ return -1;
+ }
+
+ output=yaffs_unlink(ELOOP_PATH "/file");
+ if (output==-1){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==ELOOP){
+ 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_unlink_ELOOP_dir_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_unlink_ELOOP_dir_h__
+#define __test_yaffs_unlink_ELOOP_dir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_unlink_ELOOP_dir(void);
+int test_yaffs_unlink_ELOOP_dir_clean(void);
+
+#endif