ASSERT(LIST_HEAD(&disk->file_opened_list)->succ == &fd2.link);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(kfile_close(&fd2.fd) == 0);
+ ASSERT(kfile_error(&fd2.fd) == 0);
ASSERT(LIST_EMPTY(&disk->file_opened_list));
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(buf[i] == 0xff);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(fd1.fd.seek_pos = (kfile_off_t)fd1.fd.size);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(buf[i] == i);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(fd1.fd.seek_pos == (kfile_off_t)sizeof(buf) * 3);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(fd1.fd.seek_pos == FILE_SIZE / 2);
ASSERT(fd1.fd.size == FILE_SIZE / 2);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(fd1.fd.seek_pos == FILE_SIZE / 2);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(disk->free_bytes == disk->disk_size - sizeof(buf));
}
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
for (unsigned i = 0; i < sizeof(buf); i++)
ASSERT(buf[i] == ((j-1+i) & 0xff));
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(buf[i] == (i & 0xff));
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(kfile_close(&fd2.fd) == 0);
+ ASSERT(kfile_error(&fd2.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(kfile_read(&fd1.fd, buf, sizeof(buf)) == 0);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(buf[i] == (i & 0xff));
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == 0);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
ASSERT(disk->free_bytes == 0);
ASSERT(kfile_close(&fd1.fd) == 0);
+ ASSERT(kfile_error(&fd1.fd) == BATTFS_DISK_GETNEWPAGE_ERR);
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
}
for (inode_t i = 0; i < N_FILES; i++)
+ {
ASSERT(kfile_close(&fd[i].fd) == 0);
+ ASSERT(kfile_error(&fd[i].fd) == 0);
+ }
ASSERT(battfs_fsck(disk));
ASSERT(battfs_umount(disk));
}
for (inode_t i = 0; i < N_FILES; i++)
+ {
ASSERT(kfile_close(&fd[i].fd) == 0);
+ ASSERT(kfile_error(&fd[i].fd) == 0);
+ }
ASSERT(battfs_umount(disk));
TRACEMSG("21: passed\n");