Add initial support for looking up file by path

This commit is contained in:
2017-04-23 04:10:12 -05:00
parent 32d50a42df
commit 7c54d3fb47
6 changed files with 186 additions and 26 deletions
+3
View File
@@ -32,3 +32,6 @@ add_test("Test\\ PathIterator1" FSTests PathIterator1)
add_test("Test\\ PathIterator2" FSTests PathIterator2)
add_test("Test\\ PathIterator3" FSTests PathIterator3)
add_test("Test\\ PathIterator4" FSTests PathIterator4)
add_test("Test\\ PathIterator5" FSTests PathIterator5)
add_test("Test\\ FileSystem32::findInodeOf" FSTests FileSystem32::findInodeOf)
+13
View File
@@ -90,6 +90,19 @@ map<string, int(*)(string)> tests = {
return retval;
}
},
{
"FileSystem32::findInodeOf",
[](string) {
int retval = 0;
const auto size = 1024;
uint8_t buff[size];
FileSystem32::format(buff, (FileStore32::FsSize_t) size, true);
auto fs = (FileSystem32*) createFileSystem(buff, size);
retval |= !(fs->findInodeOf("/") == FileSystem32::INODE_ROOT_DIR);
delete fs;
return retval;
}
},
},
};