test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.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_mount2.o
+ test_yaffs_mount2.o \
+ test_yaffs_unmount2.o \
+ test_yaffs_sync.o
test_yaffs_mount_ENAMETOOLONG
test_yaffs_mount_EBUSY //caused by trying to mount a new mount point with a mount point already mounted.
+ test_yaffs_mount2
+
test_yaffs_access
test_yaffs_access_ENIVAL
test_yaffs_access_ENOTDIR
test_yaffs_unmount_ENAMETOOLONG
test_yaffs_umount_EBUSY //cause by having a file handle open and then trying to unmount yaffs.
+ test_yaffs_unmount2
+
test_yaffs_write
test_yaffs_write_EBADF
test_yaffs_symlink_EROFS
- //the yaffs_mknod function does not exist in yaffsfs, so these tests will be ignored.
+ //the yaffs_mknod function does not exist in yaffsfs, so these tests will not be added.
test_yaffs_mknod
test_yaffs_mknod_EACCES
test_yaffs_mknod_EEXIST
test_yaffs_mknod_ENOTDIR
test_yaffs_mknod_EROFS
- test_yaffs_mount2
+
test_yaffs_mount2_EINVAL
test_yaffs_mount2_ENOTDIR
test_yaffs_mount2_ENOENT
test_yaffs_mount2_ENODEV
test_yaffs_mount2_ENAMETOOLONG
+
+ test_yaffs_unmount2_with handle open and forced mode on
+ test_yaffs_unmount2_with handle open and forced mode off. should give EBUSY.
test_yaffs_unmount2
test_yaffs_unmount2_ENOENT
test_yaffs_unmount2_ENOTDIR
#define NODE_PATH "/yaffs2/node"
+
+
/* warning do not define anything as FILE because there seems to be a conflict with stdio.h */
#define FILE_PATH "/yaffs2/foo"
#include "test_yaffs_mount2.h"
+#include "test_yaffs_unmount2.h"
+
+#include "test_yaffs_sync.h"
+
#include "yaffsfs.h"
#include "yaffs_error_converter.h"
#include "lib.h"
{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_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"}
+ {test_yaffs_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
+ {test_yaffs_unmount2,test_yaffs_unmount2_clean,"test_yaffs_unmount2"},
+ {test_yaffs_sync,test_yaffs_sync_clean,"test_yaffs_sync"}
--- /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.h"
+
+
+int test_yaffs_sync(void)
+{
+ return yaffs_sync(FILE_PATH);
+
+}
+
+
+int test_yaffs_sync_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_sync_h__
+#define __test_yaffs_sync_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_sync(void);
+int test_yaffs_sync_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_ENOTDIR.h"
+
+
+int test_yaffs_sync_ENOTDIR(void)
+{
+ int output = yaffs_sync("non-existing-dir/foo");
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==ENOTDIR){
+ 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_ENOTDIR_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_sync_ENOTDIR_h__
+#define __test_yaffs_sync_ENOTDIR_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_sync_ENOTDIR(void);
+int test_yaffs_sync_ENOTDIR_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_unmount2.h"
+
+int test_yaffs_unmount2(void)
+{
+ int output = -1;
+
+ output = yaffs_unmount2(YAFFS_MOUNT_POINT,1);
+ return output;
+}
+
+int test_yaffs_unmount2_clean(void)
+{
+ return test_yaffs_mount();
+}
--- /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_unmount2__
+#define __test_yaffs_unmount2__
+
+#include "yaffsfs.h"
+#include "lib.h"
+#include "test_yaffs_mount.h"
+
+int test_yaffs_unmount2(void);
+int test_yaffs_unmount2_clean(void);
+#endif