From: batt Date: Sat, 16 Feb 2008 13:07:48 +0000 (+0000) Subject: Add reopen test. X-Git-Tag: 1.0.0~137 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=99fafc49f3b2d50abb2d7b8b4cbbd3be8e107bef;p=bertos.git Add reopen test. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1115 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/app/battfs/battfs_test.c b/app/battfs/battfs_test.c index b74e227b..05d40df8 100644 --- a/app/battfs/battfs_test.c +++ b/app/battfs/battfs_test.c @@ -387,6 +387,15 @@ static void test10(BattFsSuper *disk) ASSERT(fd1.disk == disk); ASSERT(LIST_HEAD(&disk->file_opened_list) == &fd1.link); + ASSERT(kfile_reopen(&fd1.fd) == &fd1.fd); + ASSERT(fd1.fd.size == PAGE_FILL * 2); + ASSERT(fd1.fd.seek_pos == 0); + ASSERT(fd1.mode == MODE); + ASSERT(fd1.inode == INODE); + ASSERT(fd1.start == &disk->page_array[0]); + ASSERT(fd1.disk == disk); + ASSERT(LIST_HEAD(&disk->file_opened_list) == &fd1.link); + ASSERT(battfs_fileExists(disk, INODE2)); ASSERT(battfs_fileopen(disk, &fd2, INODE2, MODE)); ASSERT(fd2.fd.size == PAGE_FILL * 2);