#include #include #include #include "unity/unity.h" #include "fuse.h" #include "fuseactions.h" fuseArgStruct dummyFuse; int argc = 5; char* argv[5]; void setUp(void) { FuseStructInit(&dummyFuse); argv[0] = "bin/fuse.out"; argv[1] = "-l"; argv[2] = "test/test.txt"; argv[3] = "-f"; argv[4] = "test/fakefs"; } void tearDown(void) { ; } void Test_FuseGetArgs_Should_SetDummyArgs(void) { FuseGetArgs(argc, argv, &dummyFuse); TEST_ASSERT_EQUAL(1, dummyFuse.list); argv[1] = "-a"; FuseGetArgs(argc, argv, &dummyFuse); TEST_ASSERT_EQUAL(1, dummyFuse.add); argv[1] = "-r"; FuseGetArgs(argc, argv, &dummyFuse); TEST_ASSERT_EQUAL(1, dummyFuse.remove); argv[1] = "-e"; FuseGetArgs(argc, argv, &dummyFuse); TEST_ASSERT_EQUAL(1, dummyFuse.extract); } int main(void) { UNITY_BEGIN(); RUN_TEST(Test_FuseGetArgs_Should_SetDummyArgs); return UNITY_END(); }