yaffs More tests added to direct/timothy_tests/quick_tests/
authorTimothy Manning <tfhmanning@gmail.com>
Sun, 21 Nov 2010 21:33:48 +0000 (10:33 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Mon, 22 Nov 2010 22:21:50 +0000 (11:21 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/timothy_tests/quick_tests/Makefile
direct/timothy_tests/quick_tests/README.txt
direct/timothy_tests/quick_tests/quick_tests.h
direct/timothy_tests/quick_tests/test_yaffs_rmdir.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rmdir.h [new file with mode: 0644]

index c13265a..4d83a7e 100644 (file)
@@ -47,11 +47,14 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsf
 TESTFILES =    quick_tests.o lib.o \
                test_yaffs_mount.o test_yaffs_mount_ENODEV.o test_yaffs_mount_ENAMETOOLONG.o test_yaffs_mount_EBUSY.o \
                test_yaffs_unmount.o test_yaffs_unmount_ENODEV.o test_yaffs_unmount_ENAMETOOLONG.o test_yaffs_unmount_EBUSY.o \
-               test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o test_yaffs_open_ENAMETOOLONG.o \
+               test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o \
+               test_yaffs_open_ENAMETOOLONG.o \
                test_yaffs_open_EINVAL.o test_yaffs_open_EINVAL2.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.o  test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o \
+               test_yaffs_unlink_ENOTDIR.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.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_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\
@@ -76,7 +79,9 @@ TESTFILES =   quick_tests.o lib.o \
                test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o \
                test_yaffs_totalspace.o test_yaffs_totalspace_EINVAL.o \
                test_yaffs_inodecount.o test_yaffs_inodecount_EINVAL.o \
-               test_yaffs_link.o test_yaffs_link_ENOENT.o test_yaffs_link_EEXIST.o test_yaffs_link_ENOTDIR.o test_yaffs_link_ENOTDIR2.o
+               test_yaffs_link.o test_yaffs_link_ENOENT.o test_yaffs_link_EEXIST.o test_yaffs_link_ENOTDIR.o \
+               test_yaffs_link_ENOTDIR2.o \
+               test_yaffs_rmdir.o  
 
 
                  
index e19b94a..de90a6c 100644 (file)
@@ -45,9 +45,10 @@ Tests made
 
        test_yaffs_link
        test_yaffs_link_EEXIST
-       test_yaffs_link_ENOENT
+       test_yaffs_link_ENOENT  //note ENOENT2 does not exist because the second path is trying to create a file.
        test_yaffs_link_ENOTDIR
-
+       test_yaffs_link_ENOTDIR2
+       
        test_yaffs_lseek
        test_yaffs_lseek_EBADF
        test_yaffs_lseek_EINVAL
index 2135663..12bfe49 100644 (file)
 #include "test_yaffs_link_ENOTDIR.h"
 #include "test_yaffs_link_ENOTDIR2.h"
 
+#include "test_yaffs_rmdir.h"
+
 #include "yaffsfs.h"
 #include "yaffs_error_converter.h"
 #include "lib.h"
@@ -279,8 +281,9 @@ test_template test_list[]={
        {test_yaffs_link_ENOENT,test_yaffs_link_ENOENT_clean,"test_yaffs_link_ENOENT"},
        {test_yaffs_link_EEXIST,test_yaffs_link_EEXIST_clean,"test_yaffs_link_EEXIST"},
        {test_yaffs_link_ENOTDIR,test_yaffs_link_ENOTDIR_clean,"test_yaffs_link_ENOTDIR"},
-       {test_yaffs_link_ENOTDIR2,test_yaffs_link_ENOTDIR2_clean,"test_yaffs_link_ENOTDIR2"}
+       {test_yaffs_link_ENOTDIR2,test_yaffs_link_ENOTDIR2_clean,"test_yaffs_link_ENOTDIR2"},
 
+       {test_yaffs_rmdir,test_yaffs_rmdir_clean,"test_yaffs_rmdir"}
        };
 
 void init_quick_tests(int argc, char *argv[]);
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir.c b/direct/timothy_tests/quick_tests/test_yaffs_rmdir.c
new file mode 100644 (file)
index 0000000..3d8dbae
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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.h"
+
+
+int test_yaffs_rmdir(void)
+{
+       int output=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 yaffs_rmdir(DIR_PATH);
+}
+
+
+int test_yaffs_rmdir_clean(void)
+{
+       return -1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir.h b/direct/timothy_tests/quick_tests/test_yaffs_rmdir.h
new file mode 100644 (file)
index 0000000..e0445bc
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_h__
+#define __test_yaffs_rmdir_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rmdir(void);
+int test_yaffs_rmdir_clean(void);
+
+#endif