timed tail for logfiles. Display loglines given a minimum date and/or a maximum date.
c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ttail_argparse_empty.c 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #include <check.h>
  2. #include <errno.h>
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include "ttail_check.h"
  6. #include "ttail.h"
  7. #include "ttail_init.h"
  8. /*
  9. * Empty argument parsing test case
  10. */
  11. START_TEST (test_argparse_empty_logfilename)
  12. {
  13. ck_assert_msg(ttail->logfile_name == NULL,
  14. "ttail_t.logfile_name should be NULL");
  15. }
  16. END_TEST
  17. START_TEST (test_argparse_empty_logfile)
  18. {
  19. ck_assert_msg(ttail->logfile == NULL,
  20. "ttail_t.logfile should be NULL");
  21. }
  22. END_TEST
  23. START_TEST (test_argparse_empty_logfilesz)
  24. {
  25. ck_assert_msg(ttail->logfile_sz == 0,
  26. "ttail_t.logfile_sz should be 0");
  27. }
  28. END_TEST
  29. START_TEST (test_argparse_empty_flag)
  30. {
  31. ck_assert_msg(ttail->flag == 0,
  32. "ttail_t.flag should be 0");
  33. }
  34. END_TEST
  35. START_TEST (test_argparse_empty_fmt)
  36. {
  37. ck_assert_msg(ttail->fmt == NULL,
  38. "ttail_t.fmt should be NULL");
  39. }
  40. END_TEST
  41. START_TEST (test_argparse_empty_verbose)
  42. {
  43. ck_assert_msg(ttail->verbose == 0,
  44. "ttail_t.verbose should be 0");
  45. }
  46. END_TEST
  47. START_TEST (test_argparse_empty_prefixsz)
  48. {
  49. ck_assert_msg(ttail->prefix_sz == 0,
  50. "ttail_t.prefix_sz should be 0");
  51. }
  52. END_TEST
  53. START_TEST (test_argparse_empty_session)
  54. {
  55. ck_assert_msg(ttail->session == NULL,
  56. "ttail_t.session should be NULL");
  57. }
  58. END_TEST
  59. TTAIL_CHECK_START("ttail argument parsing checks", "empty arguments parsing")
  60. TTAIL_SET_FIXTURE(setup_ttail_empty, teardown_ttail);
  61. TTAIL_ADD_TEST(test_argparse_empty_logfilename);
  62. TTAIL_ADD_TEST(test_argparse_empty_logfile);
  63. TTAIL_ADD_TEST(test_argparse_empty_logfilesz);
  64. TTAIL_ADD_TEST(test_argparse_empty_flag);
  65. TTAIL_ADD_TEST(test_argparse_empty_fmt);
  66. TTAIL_ADD_TEST(test_argparse_empty_verbose);
  67. TTAIL_ADD_TEST(test_argparse_empty_prefixsz);
  68. TTAIL_ADD_TEST(test_argparse_empty_session);
  69. TTAIL_CHECK_END