X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_mkdir.c;fp=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_mkdir.c;h=aedaa8024b5dd4f2bec1db0fee472b5c86b91b09;hb=f0b3e63460ab0712ba14e68a482137a167f94d8f;hp=0000000000000000000000000000000000000000;hpb=d84af1d4633120e3dea173c7f91aa8cfc3421706;p=yaffs2.git diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mkdir.c b/direct/timothy_tests/quick_tests/test_yaffs_mkdir.c new file mode 100644 index 0000000..aedaa80 --- /dev/null +++ b/direct/timothy_tests/quick_tests/test_yaffs_mkdir.c @@ -0,0 +1,33 @@ +/* + * 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 + * + * 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_mkdir.h" + +static int handle = 0; + +int test_yaffs_mkdir(void) +{ + handle = yaffs_mkdir("/yaffs2/new_directory/",O_CREAT | O_RDWR); + return handle; +} + + +int test_yaffs_mkdir_clean(void) +{ + if (handle >= 0){ + return yaffs_rmdir("/yaffs2/new_directory/"); + } else { + return 1; /* the file failed to open so there is no need to close it */ + } +} +