12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include <check.h>
- #include <stdio.h>
- #include <libgen.h>
-
- #include "ttail_check.h"
- #include "ttail.h"
- #include "ttail_init.h"
- #include "ttail_search.h"
-
- /*
- * _ttail_file_minmax() tests
- */
- START_TEST (test_file_minmax1)
- {
- /**@todo complete the testcase */
- int r;
- struct tm tm[2];
- ttail->flag |= TTAIL_FLAG_PREFIX;
- ttail->prefix_sz = 0;
- ttail_set_fmt(ttail, "%b%n%d %H:%M");
- r = ttail_search_files_init(ttail);
- ck_assert_int_eq(r, 0);
- r = _ttail_file_minmax(ttail, 0, tm);
- ck_assert_int_eq(r, 0);
- ck_assert_int_eq(tm[0].tm_mon, 2);
- ck_assert_int_eq(tm[0].tm_mday, 6);
- ck_assert_int_eq(tm[0].tm_hour, 0);
- ck_assert_int_eq(tm[0].tm_min, 1);
- ck_assert_int_eq(tm[1].tm_mon, 2);
- ck_assert_int_eq(tm[1].tm_mday, 6);
- ck_assert_int_eq(tm[1].tm_hour, 0);
- ck_assert_int_eq(tm[1].tm_min, 29);
- }
- END_TEST
-
- TTAIL_CHECK_START("ttail search_files checks", "ttail_file_minmax() checks")
- TTAIL_SET_FIXTURE(setup_closest_fileinit, teardown_closest_fileinit);
- TTAIL_ADD_TEST(test_file_minmax1);
- TTAIL_CHECK_END
|