2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Timothy Manning <timothy@yaffs.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include "test_yaffs_rename_dir.h"
15 /*tests renaming a non empty file */
16 int test_yaffs_rename_dir(void)
20 output = yaffs_open(YAFFS_MOUNT_POINT "/new_directory/file",O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
23 if (0 != yaffs_access(FILE_PATH,0)) {
24 output = test_yaffs_open();
26 print_message("failed to create file\n",2);
30 output = yaffs_rename( DIR_PATH , RENAME_DIR_PATH);
35 int test_yaffs_rename_dir_clean(void)
38 if (0 == yaffs_access(YAFFS_MOUNT_POINT "/new_directory/file",0)) {
39 output = yaffs_unlink(YAFFS_MOUNT_POINT "/new_directory/file");
41 print_message("failed to remove file\n",2);
46 if (0 == yaffs_access(RENAME_DIR_PATH,0)) {
47 output = yaffs_rename(RENAME_DIR_PATH,DIR_PATH);
49 print_message("failed to rename the dir\n",2);