"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/misc_tests.c" between
vnstat-2.8.tar.gz and vnstat-2.9.tar.gz

About: vnStat is a console-based network traffic monitor (using the /proc filesystem).

misc_tests.c  (vnstat-2.8):misc_tests.c  (vnstat-2.9)
skipping to change at line 389 skipping to change at line 389
ck_assert_int_eq(intsignal, SIGTERM); ck_assert_int_eq(intsignal, SIGTERM);
} }
END_TEST END_TEST
START_TEST(validatedatetime_can_detect_valid_strings) START_TEST(validatedatetime_can_detect_valid_strings)
{ {
ck_assert_int_eq(validatedatetime("2018-03-24 01:23"), 1); ck_assert_int_eq(validatedatetime("2018-03-24 01:23"), 1);
ck_assert_int_eq(validatedatetime("1998-01-15 23:16"), 1); ck_assert_int_eq(validatedatetime("1998-01-15 23:16"), 1);
ck_assert_int_eq(validatedatetime("2018-03-24"), 1); ck_assert_int_eq(validatedatetime("2018-03-24"), 1);
ck_assert_int_eq(validatedatetime("1998-01-15"), 1); ck_assert_int_eq(validatedatetime("1998-01-15"), 1);
ck_assert_int_eq(validatedatetime("today"), 1);
} }
END_TEST END_TEST
START_TEST(validatedatetime_can_detect_invalid_strings) START_TEST(validatedatetime_can_detect_invalid_strings)
{ {
ck_assert_int_eq(validatedatetime("2018-03-24 01:23:12"), 0); ck_assert_int_eq(validatedatetime("2018-03-24 01:23:12"), 0);
ck_assert_int_eq(validatedatetime("2018-03-24 01"), 0); ck_assert_int_eq(validatedatetime("2018-03-24 01"), 0);
ck_assert_int_eq(validatedatetime("2018-03-24 01:23am"), 0); ck_assert_int_eq(validatedatetime("2018-03-24 01:23am"), 0);
ck_assert_int_eq(validatedatetime("2018-03-24 1:23"), 0); ck_assert_int_eq(validatedatetime("2018-03-24 1:23"), 0);
ck_assert_int_eq(validatedatetime("2018-03-24 01-23"), 0); ck_assert_int_eq(validatedatetime("2018-03-24 01-23"), 0);
skipping to change at line 421 skipping to change at line 422
ck_assert_int_eq(validatedatetime("2018-3"), 0); ck_assert_int_eq(validatedatetime("2018-3"), 0);
ck_assert_int_eq(validatedatetime("2018_03"), 0); ck_assert_int_eq(validatedatetime("2018_03"), 0);
ck_assert_int_eq(validatedatetime("2018"), 0); ck_assert_int_eq(validatedatetime("2018"), 0);
ck_assert_int_eq(validatedatetime("1998"), 0); ck_assert_int_eq(validatedatetime("1998"), 0);
ck_assert_int_eq(validatedatetime("9999"), 0); ck_assert_int_eq(validatedatetime("9999"), 0);
ck_assert_int_eq(validatedatetime("18-03"), 0); ck_assert_int_eq(validatedatetime("18-03"), 0);
ck_assert_int_eq(validatedatetime("18"), 0); ck_assert_int_eq(validatedatetime("18"), 0);
ck_assert_int_eq(validatedatetime(" "), 0); ck_assert_int_eq(validatedatetime(" "), 0);
ck_assert_int_eq(validatedatetime(""), 0); ck_assert_int_eq(validatedatetime(""), 0);
ck_assert_int_eq(validatedatetime("wtf?"), 0); ck_assert_int_eq(validatedatetime("wtf?"), 0);
ck_assert_int_eq(validatedatetime("yesterday"), 0);
ck_assert_int_eq(validatedatetime("tomorrow"), 0);
} }
END_TEST END_TEST
START_TEST(validatedatetime_does_not_validate_numbers) START_TEST(validatedatetime_does_not_validate_numbers)
{ {
ck_assert_int_eq(validatedatetime("9999-99-99 99:99"), 1); ck_assert_int_eq(validatedatetime("9999-99-99 99:99"), 1);
ck_assert_int_eq(validatedatetime("0000-00-00 00:00"), 1); ck_assert_int_eq(validatedatetime("0000-00-00 00:00"), 1);
ck_assert_int_eq(validatedatetime("2018-03-24 01:90"), 1); ck_assert_int_eq(validatedatetime("2018-03-24 01:90"), 1);
} }
END_TEST END_TEST
 End of changes. 2 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)