"Fossies" - the Fresh Open Source Software Archive  

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

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

ifinfo_tests.c  (vnstat-2.7):ifinfo_tests.c  (vnstat-2.8)
skipping to change at line 339 skipping to change at line 339
fake_proc_net_dev("a", "eth1", 1, 2, 3, 4); fake_proc_net_dev("a", "eth1", 1, 2, 3, 4);
suppress_output(); suppress_output();
ck_assert_int_eq(isifavailable("eth0"), 1); ck_assert_int_eq(isifavailable("eth0"), 1);
ck_assert_int_eq(isifavailable("eth1"), 1); ck_assert_int_eq(isifavailable("eth1"), 1);
ck_assert_int_eq(isifavailable("eth2"), 0); ck_assert_int_eq(isifavailable("eth2"), 0);
} }
END_TEST END_TEST
START_TEST(istun_knows_what_a_tun_interface_looks_like)
{
linuxonly;
ck_assert_int_eq(istun("eth0"), 0);
ck_assert_int_eq(istun("not_tun0"), 0);
ck_assert_int_eq(istun("tun"), 0);
ck_assert_int_eq(istun("tuna"), 0);
ck_assert_int_eq(istun("tun0"), 1);
ck_assert_int_eq(istun("tun1"), 1);
ck_assert_int_eq(istun("tun12"), 1);
ck_assert_int_eq(istun("tun123"), 1);
ck_assert_int_eq(istun("tun1234"), 1);
}
END_TEST
void add_ifinfo_tests(Suite *s) void add_ifinfo_tests(Suite *s)
{ {
TCase *tc_ifinfo = tcase_create("Ifinfo"); TCase *tc_ifinfo = tcase_create("Ifinfo");
tcase_add_checked_fixture(tc_ifinfo, setup, teardown); tcase_add_checked_fixture(tc_ifinfo, setup, teardown);
tcase_add_unchecked_fixture(tc_ifinfo, setup, teardown); tcase_add_unchecked_fixture(tc_ifinfo, setup, teardown);
tcase_add_test(tc_ifinfo, getifliststring_no_source); tcase_add_test(tc_ifinfo, getifliststring_no_source);
tcase_add_test(tc_ifinfo, getifliststring_proc_one_interface); tcase_add_test(tc_ifinfo, getifliststring_proc_one_interface);
tcase_add_test(tc_ifinfo, getifliststring_proc_one_interface_with_speed); tcase_add_test(tc_ifinfo, getifliststring_proc_one_interface_with_speed);
tcase_add_test(tc_ifinfo, getifliststring_proc_multiple_interfaces); tcase_add_test(tc_ifinfo, getifliststring_proc_multiple_interfaces);
tcase_add_test(tc_ifinfo, getifliststring_proc_multiple_interfaces_valida ting); tcase_add_test(tc_ifinfo, getifliststring_proc_multiple_interfaces_valida ting);
skipping to change at line 363 skipping to change at line 379
tcase_add_test(tc_ifinfo, getifliststring_sysclassnet_multiple_interfaces _validating); tcase_add_test(tc_ifinfo, getifliststring_sysclassnet_multiple_interfaces _validating);
tcase_add_test(tc_ifinfo, getifliststring_sysclassnet_long_interface_name s); tcase_add_test(tc_ifinfo, getifliststring_sysclassnet_long_interface_name s);
tcase_add_test(tc_ifinfo, readproc_no_file); tcase_add_test(tc_ifinfo, readproc_no_file);
tcase_add_test(tc_ifinfo, readproc_not_found); tcase_add_test(tc_ifinfo, readproc_not_found);
tcase_add_test(tc_ifinfo, readproc_success); tcase_add_test(tc_ifinfo, readproc_success);
tcase_add_test(tc_ifinfo, readsysclassnet_not_found); tcase_add_test(tc_ifinfo, readsysclassnet_not_found);
tcase_add_test(tc_ifinfo, readsysclassnet_success); tcase_add_test(tc_ifinfo, readsysclassnet_success);
tcase_add_test(tc_ifinfo, getifinfo_not_found); tcase_add_test(tc_ifinfo, getifinfo_not_found);
tcase_add_test(tc_ifinfo, getifinfo_success); tcase_add_test(tc_ifinfo, getifinfo_success);
tcase_add_test(tc_ifinfo, isifavailable_knows_interface_availability); tcase_add_test(tc_ifinfo, isifavailable_knows_interface_availability);
tcase_add_test(tc_ifinfo, istun_knows_what_a_tun_interface_looks_like);
suite_add_tcase(s, tc_ifinfo); suite_add_tcase(s, tc_ifinfo);
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 17 lines changed or added

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