* published by the Free Software Foundation.
*/
-#include "test_yaffs_link_ELOOP_dir.h"
+#include "test_yaffs_link_EROFS.h"
-int test_yaffs_link_ELOOP_dir(void)
+int test_yaffs_link_EROFS(void)
{
int output=0;
int error =0;
- if (set_up_ELOOP()<0){
- print_message("failed to setup symlinks\n",2);
- return -1;
- }
+ EROFS_setup();
- output = yaffs_link(ELOOP_PATH "/file",HARD_LINK_PATH);
+ output = yaffs_link(FILE_PATH,HARD_LINK_PATH);
if (output<0){
error=yaffs_get_error();
- if (abs(error)==ELOOP){
+ if (abs(error)==EROFS){
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);
+ print_message("created a hard link with EROFS set (which is a bad thing)\n",2);
return -1;
}
}
-int test_yaffs_link_ELOOP_dir_clean(void)
+int test_yaffs_link_EROFS_clean(void)
{
int output=0;
int error =0;
error=yaffs_get_error();
if (abs(error)==ENOENT){
//if the file does not exist then the error should be ENOENT.
- return 1;
+ return EROFS_clean();
} 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 */
+ return EROFS_clean(); /* the file failed to open so there is no need to close it */
}
}