1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include <check.h>
- #include <errno.h>
- #include <stdio.h>
- #include <unistd.h>
-
- #include "ttail_check.h"
- #include "ttail.h"
- #include "ttail_init.h"
-
- /*
- * Bad arguments
- */
-
- START_TEST (test_argparse_bad1)
- {
- ttail_t *t;
- char *args[] = {"foo", "--sdfsdf"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad2)
- {
- ttail_t *t;
- char *args[] = {"foo", "-x"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad3)
- {
- ttail_t *t;
- char *args[] = {"foo", "-p"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad4)
- {
- ttail_t *t;
- char *args[] = {"foo", "-f"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad5)
- {
- ttail_t *t;
- char *args[] = {"foo", "-d"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad6)
- {
- ttail_t *t;
- char *args[] = {"foo", "-m"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- START_TEST (test_argparse_bad7)
- {
- ttail_t *t;
- char *args[] = {"foo", "-l"};
- t = ttail_init(2, args);
- ck_assert(t == NULL);
- }
- END_TEST
-
- TTAIL_CHECK_START("ttail argument parsing checks", "bad arguments parsing")
- TTAIL_ADD_TEST(test_argparse_bad1);
- TTAIL_ADD_TEST(test_argparse_bad2);
- TTAIL_ADD_TEST(test_argparse_bad3);
- TTAIL_ADD_TEST(test_argparse_bad4);
- TTAIL_ADD_TEST(test_argparse_bad5);
- TTAIL_ADD_TEST(test_argparse_bad6);
- TTAIL_ADD_TEST(test_argparse_bad7);
- TTAIL_CHECK_END
|