stuffy/test/test.c

63 lines
1.2 KiB
C
Raw Normal View History

2022-11-10 18:30:35 -06:00
#include <unistd.h>
2022-11-02 15:29:00 -05:00
#include "unity.h"
#include "stuffy.h"
2022-11-02 15:56:26 -05:00
int argc = 0;
char* argv[6];
2022-11-02 15:29:00 -05:00
void setUp(void)
{
2022-11-10 18:30:35 -06:00
argv[0] = "bin/stuffy.out";
2022-11-02 15:56:26 -05:00
argv[1] = "-a";
2022-11-10 18:30:35 -06:00
argv[2] = "test/files/mystuffyarchive.test";
argv[3] = "test/files/temp.test";
2022-11-02 15:56:26 -05:00
argv[4] = ">";
2022-11-10 18:30:35 -06:00
argv[5] = "test/files/output.test";
2022-11-02 15:29:00 -05:00
}
void tearDown(void)
{
;
}
2022-11-02 15:56:26 -05:00
void Test_StuffyArgument_Should_ReturnCorrectly(void)
2022-11-02 15:29:00 -05:00
{
2022-11-02 15:56:26 -05:00
TEST_ASSERT_EQUAL(0, StuffyArgument(4, argv));
argv[1] = "-r";
TEST_ASSERT_EQUAL(1, StuffyArgument(4, argv));
argv[1] = "-l";
TEST_ASSERT_EQUAL(2, StuffyArgument(3, argv));
argv[1] = "-e";
TEST_ASSERT_EQUAL(3, StuffyArgument(6, argv));
argv[1] = "-t";
TEST_ASSERT_EQUAL(-1, StuffyArgument(4, argv));
2022-11-02 15:29:00 -05:00
}
2022-11-10 18:30:35 -06:00
void Test_AddToArchive_Should_AddCorrectly(void)
{
;
}
void Test_RemoveFromArchive_Should_RemoveCorrectly(void)
{
;
}
void Test_ListArchive_Should_ListCorrectly(void)
{
;
}
void Test_ExtractArchive_Should_ExtractCorrectly(void)
{
;
}
2022-11-02 15:56:26 -05:00
2022-11-02 15:29:00 -05:00
int main(void)
{
UNITY_BEGIN();
2022-11-10 18:30:35 -06:00
remove("test/files/mystuffyarchive.test");
2022-11-02 15:56:26 -05:00
RUN_TEST(Test_StuffyArgument_Should_ReturnCorrectly);
2022-11-02 15:29:00 -05:00
return UNITY_END();
}