12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #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
-
- Suite * ttail_init_suite(void)
- {
- Suite *s;
- TCase *tc_argparse_badarg;
-
- s = suite_create("ttail argument parsing checks");
-
- tc_argparse_badarg = tcase_create("bad arguments parsing");
- tcase_add_test(tc_argparse_badarg, test_argparse_bad1);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad2);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad3);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad4);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad5);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad6);
- tcase_add_test(tc_argparse_badarg, test_argparse_bad7);
-
- suite_add_tcase(s, tc_argparse_badarg);
- return s;
- }
-
- TTAIL_CHECK_MAIN(ttail_init_suite)
|