ASSERT(battfs_fsck(disk));
ASSERT(battfs_fileopen(disk, &fd1, INODE, MODE));
ASSERT(kfile_write(&fd1.fd, buf, sizeof(buf)) == PAGE_FILL * 4);
- ASSERT(fd1.fd.size == PAGE_FILL * 4);
- ASSERT(fd1.fd.seek_pos == PAGE_FILL * 4);
+ ASSERT(fd1.fd.size == (kfile_off_t)(PAGE_FILL * 4));
+ ASSERT(fd1.fd.seek_pos == (kfile_off_t)(PAGE_FILL * 4));
ASSERT(disk->free_bytes == 0);
ASSERT(kfile_close(&fd1.fd) == 0);
#define N_FILES 10
BattFs fd[N_FILES];
- inode_t INODE = 0;
unsigned int MODE = BATTFS_CREATE;
uint32_t buf[FILE_SIZE / (4 * N_FILES * sizeof(uint32_t))];
for (uint32_t j = 0; j < countof(buf); j++)
buf[j] = j+i;
- ASSERT(kfile_write(&fd[i], buf, sizeof(buf)) == sizeof(buf));
+ ASSERT(kfile_write(&fd[i].fd, buf, sizeof(buf)) == sizeof(buf));
ASSERT(fd[i].fd.size == sizeof(buf));
ASSERT(fd[i].fd.seek_pos == sizeof(buf));
ASSERT(kfile_seek(&fd[i].fd, 0, SEEK_SET) == 0);
for (inode_t i = 0; i < N_FILES; i++)
{
memset(buf, 0, sizeof(buf));
- ASSERT(kfile_read(&fd[i], buf, sizeof(buf)) == sizeof(buf));
+ ASSERT(kfile_read(&fd[i].fd, buf, sizeof(buf)) == sizeof(buf));
for (uint32_t j = 0; j < countof(buf); j++)
ASSERT(buf[j] == j+i);
for (inode_t i = 0; i < N_FILES; i++)
{
memset(buf, 0, sizeof(buf));
- ASSERT(kfile_read(&fd[i], buf, sizeof(buf)) == sizeof(buf));
+ ASSERT(kfile_read(&fd[i].fd, buf, sizeof(buf)) == sizeof(buf));
for (uint32_t j = 0; j < countof(buf); j++)
ASSERT(buf[j] == j+i);