Fixed structure of inodes, setup testing for opening and adding fs
This commit is contained in:
+21
-2
@@ -5,6 +5,7 @@
|
||||
#include "fuse.h"
|
||||
#include "fuseactions.h"
|
||||
|
||||
FileSystem* fakefs;
|
||||
fuseArgStruct dummyFuse;
|
||||
int argc = 5;
|
||||
char* argv[5];
|
||||
@@ -14,9 +15,9 @@ void setUp(void)
|
||||
FuseStructInit(&dummyFuse);
|
||||
argv[0] = "bin/fuse.out";
|
||||
argv[1] = "-l";
|
||||
argv[2] = "test/test.txt";
|
||||
argv[2] = "test/files/test1.txt";
|
||||
argv[3] = "-f";
|
||||
argv[4] = "test/fakefs";
|
||||
argv[4] = "test/fakefs.test";
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
@@ -48,10 +49,28 @@ void Test_FindEmptyBitPosition_Should_ReturnPosition(void)
|
||||
TEST_ASSERT_EQUAL(-1, FindEmptyBitPosition(4294967295));
|
||||
}
|
||||
|
||||
void Test_FileSystem_Should_SuccessfullyOpen(void)
|
||||
{
|
||||
remove(argv[4]);
|
||||
GetArguments(argc, argv, &dummyFuse);
|
||||
OpenFS(&dummyFuse, argv[0]);
|
||||
fakefs = SetupFS(&dummyFuse);
|
||||
}
|
||||
|
||||
void Test_FileSystem_Should_AddFile(void)
|
||||
{
|
||||
argv[1] = "-a";
|
||||
GetArguments(argc, argv, &dummyFuse);
|
||||
RunFuse(fakefs, &dummyFuse);
|
||||
TEST_ASSERT_EQUAL(1, fakefs->inodes[1].isValid);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(Test_FuseGetArgs_Should_SetDummyArgs);
|
||||
RUN_TEST(Test_FindEmptyBitPosition_Should_ReturnPosition);
|
||||
RUN_TEST(Test_FileSystem_Should_SuccessfullyOpen);
|
||||
RUN_TEST(Test_FileSystem_Should_AddFile);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user