test_yaffs_sync.o test_yaffs_sync_ENODEV.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.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_fdatasync
test_yaffs_fdatasync_EBADF
+ test_yaffs_freespace
+ test_yaffs_freespace_EINVAL
+
test_yaffs_fsync
test_yaffs_fsync_EBADF
test_yaffs_ftruncate_ENIVAL
test_yaffs_ftruncate_big_file
+ test_yaffs_inodecount
+ test_yaffs_inodecount_ENOTDIR
+
+ test_yaffs_link
+ test_yaffs_link_EEXIST
+ test_yaffs_link_ENOENT
+ test_yaffs_link_ENOTDIR
+
test_yaffs_lseek
test_yaffs_lseek_EBADF
test_yaffs_lseek_EINVAL
test_yaffs_remount_ENODEV
test_yaffs_remount_EINVAL
+ test_yaffs_totalspace
+ test_yaffs_totalspace_EINVAL
+
test_yaffs_truncate
test_yaffs_truncate_ENOTDIR
test_yaffs_truncate_EISDIR
test_yaffs_remount_ENOTDIR //cannot be generated in yaffs
- test_yaffs_sync_ENOENT
-
- test_yaffs_freespace
- test_yaffs_freespace_EINVAL
test_yaffs_freespace_ENAMETOOLONG
-
- test_yaffs_totalspace
- test_yaffs_totalspace_ENOTDIR
- test_yaffs_totalspace_ENOENT
-
- test_yaffs_inodecount
- test_yaffs_inodecount_ENOTDIR
- test_yaffs_inodecount_ENOENT
+ test_yaffs_totalspace_ENAMETOOLONG
+ test_yaffs_inodecount_ENAMETOOLONG
test_yaffs_opendir
test_yaffs_closedir
- test_yaffs_link
+
test_yaffs_link_EACCES
- test_yaffs_link_EEXISTS
+
test_yaffs_link_ELOOP
test_yaffs_link_EMLINK //should not happen on yaffs
test_yaffs_link_ENAMETOOLONG
- test_yaffs_link_ENOENT
- test_yaffs_link_ENOTDIR
test_yaffs_link_EPERM
test_yaffs_link_EROFS
#define SYMLINK_PATH "/yaffs2/sym_foo"
+#define HARD_LINK_PATH "/yaffs2/hard_link"
+
#define NODE_PATH "/yaffs2/node"
#include "test_yaffs_remount_EINVAL.h"
#include "test_yaffs_freespace.h"
+#include "test_yaffs_freespace_EINVAL.h"
+
+#include "test_yaffs_totalspace.h"
+#include "test_yaffs_totalspace_EINVAL.h"
+
+#include "test_yaffs_inodecount.h"
+#include "test_yaffs_inodecount_EINVAL.h"
+
+#include "test_yaffs_link.h"
+#include "test_yaffs_link_ENOENT.h"
+#include "test_yaffs_link_EEXIST.h"
+#include "test_yaffs_link_ENOTDIR.h"
+#include "test_yaffs_link_ENOTDIR2.h"
#include "yaffsfs.h"
#include "yaffs_error_converter.h"
{test_yaffs_remount_ENODEV,test_yaffs_remount_ENODEV_clean,"test_yaffs_remount_ENODEV"},
{test_yaffs_remount_EINVAL,test_yaffs_remount_EINVAL_clean,"test_yaffs_remount_EINVAL"},
- {test_yaffs_freespace,test_yaffs_freespace_clean,"test_yaffs_freespace"}
+ {test_yaffs_freespace,test_yaffs_freespace_clean,"test_yaffs_freespace"},
+ {test_yaffs_freespace_EINVAL,test_yaffs_freespace_EINVAL_clean,"test_yaffs_freespace_EINVAL"},
+
+ {test_yaffs_totalspace,test_yaffs_totalspace_clean,"test_yaffs_totalspace"},
+ {test_yaffs_totalspace_EINVAL,test_yaffs_totalspace_EINVAL_clean,"test_yaffs_totalspace_EINVAL"},
+
+ {test_yaffs_inodecount,test_yaffs_inodecount_clean,"test_yaffs_inodecount"},
+ {test_yaffs_inodecount_EINVAL,test_yaffs_inodecount_EINVAL_clean,"test_yaffs_inodecount_EINVAL"},
+
+ {test_yaffs_link,test_yaffs_link_clean,"test_yaffs_link"},
+ {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"}
+
};
void init_quick_tests(int argc, char *argv[]);
--- /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_freespace_EINVAL.h"
+
+
+
+int test_yaffs_freespace_EINVAL(void)
+{
+ int output=0;
+ int error=0;
+ output = yaffs_freespace("non-existing-mount-point");
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EINVAL){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("got the free space of a non existing mountpoint (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_freespace_EINVAL_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_freespace_EINVAL_h__
+#define __test_yaffs_freespace_EINVAL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_freespace_EINVAL(void);
+int test_yaffs_freespace_EINVAL_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_inodecount.h"
+
+
+
+int test_yaffs_inodecount(void)
+{
+ int output=0;
+ output = yaffs_inodecount(YAFFS_MOUNT_POINT);
+ return output;
+}
+
+
+int test_yaffs_inodecount_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_inodecount_h__
+#define __test_yaffs_inodecount_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_inodecount(void);
+int test_yaffs_inodecount_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_inodecount_EINVAL.h"
+
+
+
+int test_yaffs_inodecount_EINVAL(void)
+{
+ int output=0;
+ int error=0;
+ output = yaffs_inodecount("non-existing-mount-point");
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EINVAL){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("got the inodecount of a non existing mountpoint (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_inodecount_EINVAL_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_inodecount_EINVAL_h__
+#define __test_yaffs_inodecount_EINVAL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_inodecount_EINVAL(void);
+int test_yaffs_inodecount_EINVAL_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_link.h"
+
+
+
+int test_yaffs_link(void)
+{
+ int output=0;
+ output = yaffs_link(FILE_PATH,HARD_LINK_PATH);
+ return output;
+}
+
+
+int test_yaffs_link_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } 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_link_h__
+#define __test_yaffs_link_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link(void);
+int test_yaffs_link_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_link_EEXIST.h"
+
+
+
+int test_yaffs_link_EEXIST(void)
+{
+ int output=0;
+ int error =0;
+
+ output = yaffs_link(FILE_PATH,HARD_LINK_PATH);
+ if (output<0){
+ print_message("failed to create the first hard link\n",2);
+ return -1;
+ }
+
+ output = yaffs_link(FILE_PATH,HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EEXIST){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a hard link to a non-existing-file (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_link_EEXIST_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } 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_link_EEXIST_h__
+#define __test_yaffs_link_EEXIST_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_EEXIST(void);
+int test_yaffs_link_EEXIST_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_link_ENOENT.h"
+
+
+
+int test_yaffs_link_ENOENT(void)
+{
+ int output=0;
+ int error =0;
+ output = yaffs_link("/yaffs2/non-existing-file",HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a hard link to a non-existing-file (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_link_ENOENT_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } 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_link_ENOENT_h__
+#define __test_yaffs_link_ENOENT_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ENOENT(void);
+int test_yaffs_link_ENOENT_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_link_ENOTDIR.h"
+
+
+
+int test_yaffs_link_ENOTDIR(void)
+{
+ int output=0;
+ int error =0;
+ output = yaffs_link("/non-existing-dir/foo",HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOTDIR){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a hard link to a non-existing-dir (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_link_ENOTDIR_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } 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_link_ENOTDIR_h__
+#define __test_yaffs_link_ENOTDIR_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ENOTDIR(void);
+int test_yaffs_link_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_link_ENOTDIR2.h"
+
+
+
+int test_yaffs_link_ENOTDIR2(void)
+{
+ int output=0;
+ int error =0;
+ output = yaffs_link(FILE_PATH,"non-existing-directory/hard_link");
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOTDIR){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a hard link to a non-existing-dir (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_link_ENOTDIR2_clean(void)
+{
+ int output=0;
+ int error =0;
+ output= yaffs_unlink(HARD_LINK_PATH);
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==ENOENT){
+ //if the file does not exist then the error should be ENOENT.
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } 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_link_ENOTDIR2_h__
+#define __test_yaffs_link_ENOTDIR2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ENOTDIR2(void);
+int test_yaffs_link_ENOTDIR2_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_totalspace.h"
+
+
+
+int test_yaffs_totalspace(void)
+{
+ int output=0;
+ output = yaffs_totalspace(YAFFS_MOUNT_POINT);
+ return output;
+}
+
+
+int test_yaffs_totalspace_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_totalspace_h__
+#define __test_yaffs_totalspace_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_totalspace(void);
+int test_yaffs_totalspace_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_totalspace_EINVAL.h"
+
+
+
+int test_yaffs_totalspace_EINVAL(void)
+{
+ int output=0;
+ int error=0;
+ output = yaffs_totalspace("non-existing-mount-point");
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EINVAL){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("got the totalspace of a non existing mountpoint (which is a bad thing)\n",2);
+ return -1;
+ }
+}
+
+
+int test_yaffs_totalspace_EINVAL_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_totalspace_EINVAL_h__
+#define __test_yaffs_totalspace_EINVAL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_totalspace_EINVAL(void);
+int test_yaffs_totalspace_EINVAL_clean(void);
+
+#endif