END_TEST /** Create the suite including all tests for this module */ Suite * tcp_suite(void) { testfunc tests[] = { TESTFUNC(test_tcp_new_abort), TESTFUNC(test_tcp_listen_passive_open), TESTFUNC(test_tcp_recv_inseq), TESTFUNC(test_tcp_recv_inseq_trim), TESTFUNC(test_tcp_passive_close), TESTFUNC(test_tcp_malformed_header), TESTFUNC(test_tcp_fast_retx_recover), TESTFUNC(test_tcp_fast_rexmit_wraparound), TESTFUNC(test_tcp_rto_rexmit_wraparound), TESTFUNC(test_tcp_tx_full_window_lost_from_unacked), TESTFUNC(test_tcp_tx_full_window_lost_from_unsent), TESTFUNC(test_tcp_rto_tracking), TESTFUNC(test_tcp_rto_timeout), TESTFUNC(test_tcp_zwp_timeout), TESTFUNC(test_tcp_persist_split) }; return create_suite("TCP", tests, sizeof(tests)/sizeof(testfunc), tcp_setup, tcp_teardown); }
/** Create the suite including all tests for this module */ Suite * tcp_oos_suite(void) { testfunc tests[] = { TESTFUNC(test_tcp_recv_ooseq_FIN_OOSEQ), TESTFUNC(test_tcp_recv_ooseq_FIN_INSEQ), TESTFUNC(test_tcp_recv_ooseq_overrun_rxwin), TESTFUNC(test_tcp_recv_ooseq_overrun_rxwin_edge), TESTFUNC(test_tcp_recv_ooseq_max_bytes), TESTFUNC(test_tcp_recv_ooseq_max_pbufs), TESTFUNC(test_tcp_recv_ooseq_double_FIN_0), TESTFUNC(test_tcp_recv_ooseq_double_FIN_1), TESTFUNC(test_tcp_recv_ooseq_double_FIN_2), TESTFUNC(test_tcp_recv_ooseq_double_FIN_3), TESTFUNC(test_tcp_recv_ooseq_double_FIN_4), TESTFUNC(test_tcp_recv_ooseq_double_FIN_5), TESTFUNC(test_tcp_recv_ooseq_double_FIN_6), TESTFUNC(test_tcp_recv_ooseq_double_FIN_7), TESTFUNC(test_tcp_recv_ooseq_double_FIN_8), TESTFUNC(test_tcp_recv_ooseq_double_FIN_9), TESTFUNC(test_tcp_recv_ooseq_double_FIN_10), TESTFUNC(test_tcp_recv_ooseq_double_FIN_11), TESTFUNC(test_tcp_recv_ooseq_double_FIN_12), TESTFUNC(test_tcp_recv_ooseq_double_FIN_13), TESTFUNC(test_tcp_recv_ooseq_double_FIN_14), TESTFUNC(test_tcp_recv_ooseq_double_FIN_15) }; return create_suite("TCP_OOS", tests, sizeof(tests)/sizeof(testfunc), tcp_oos_setup, tcp_oos_teardown); }
int main( void ) { int num_fail; Suite *s = create_suite(); SRunner *sr = srunner_create(s); srunner_run_all (sr, CK_NORMAL); num_fail = srunner_ntests_failed (sr); srunner_free (sr); return (num_fail == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
END_TEST Suite * ip6_suite(void) { testfunc tests[] = { TESTFUNC(test_ip6_dummy), }; return create_suite("IPv6", tests, sizeof(tests)/sizeof(testfunc), NULL, NULL); }
void test_run_zero_tests_has_zero_failures() { suite_t* suite = create_suite(); silence_suite(suite); run_suite(suite); expect(get_failure_count(suite) == 0); destroy_suite(suite); }
END_TEST /** Create the suite including all tests for this module */ Suite * mem_suite(void) { TFun tests[] = { test_mem_one, }; return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * udp_suite(void) { TFun tests[] = { test_udp_new_remove, }; return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * udp_suite(void) { testfunc tests[] = { TESTFUNC(test_udp_new_remove), TESTFUNC(test_udp_broadcast_rx_with_2_netifs) }; return create_suite("UDP", tests, sizeof(tests)/sizeof(testfunc), udp_setup, udp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * tcp_oos_suite(void) { TFun tests[] = { test_tcp_recv_ooseq_FIN_OOSEQ, test_tcp_recv_ooseq_FIN_INSEQ, }; return create_suite("TCP_OOS", tests, sizeof(tests)/sizeof(TFun), tcp_oos_setup, tcp_oos_teardown); }
void test_expect_unexpected_fails() { suite_t* suite = create_suite(); silence_suite(suite); add_test_to_suite(suite, expect_unexpected); run_suite(suite); expect(get_failure_count(suite) == 1); destroy_suite(suite); }
END_TEST /** Create the suite including all tests for this module */ Suite * etharp_suite(void) { TFun tests[] = { test_etharp_table, }; return create_suite("ETHARP", tests, sizeof(tests)/sizeof(TFun), etharp_setup, etharp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * mem_suite(void) { testfunc tests[] = { TESTFUNC(test_mem_one), TESTFUNC(test_mem_random) }; return create_suite("MEM", tests, sizeof(tests)/sizeof(testfunc), mem_setup, mem_teardown); }
int main( void ) { openlog("ecutools-testsuite", LOG_CONS | LOG_PERROR, LOG_USER); syslog(LOG_DEBUG, "starting ecutools-j2534-testsuite"); int num_fail; Suite *suite = create_suite(); SRunner *sr = srunner_create(suite); srunner_run_all(sr, CK_NORMAL); num_fail = srunner_ntests_failed(sr); srunner_free (sr); closelog(); return (num_fail == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
END_TEST /** Create the suite including all tests for this module */ Suite * tcp_suite(void) { TFun tests[] = { test_tcp_new_abort, test_tcp_recv_inseq, }; return create_suite("TCP", tests, sizeof(tests)/sizeof(TFun), tcp_setup, tcp_teardown); }
void test_two_failed_tests() { suite_t* suite = create_suite(); silence_suite(suite); add_test_to_suite(suite, fails); add_test_to_suite(suite, also_fails); run_suite(suite); expect(get_failure_count(suite) == 2); destroy_suite(suite); }
END_TEST /** Create the suite including all tests for this module */ Suite * sockets_suite(void) { testfunc tests[] = { TESTFUNC(test_sockets_basics), TESTFUNC(test_sockets_allfunctions_basic), TESTFUNC(test_sockets_msgapis), TESTFUNC(test_sockets_select), TESTFUNC(test_sockets_recv_after_rst), }; return create_suite("SOCKETS", tests, sizeof(tests)/sizeof(testfunc), sockets_setup, sockets_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * pbuf_suite(void) { testfunc tests[] = { TESTFUNC(test_pbuf_copy_zero_pbuf), TESTFUNC(test_pbuf_split_64k_on_small_pbufs), TESTFUNC(test_pbuf_queueing_bigger_than_64k), TESTFUNC(test_pbuf_take_at_edge), TESTFUNC(test_pbuf_get_put_at_edge) }; return create_suite("PBUF", tests, sizeof(tests)/sizeof(testfunc), pbuf_setup, pbuf_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * dhcp_suite(void) { testfunc tests[] = { TESTFUNC(test_dhcp), TESTFUNC(test_dhcp_nak), TESTFUNC(test_dhcp_relayed), TESTFUNC(test_dhcp_nak_no_endmarker) }; return create_suite("DHCP", tests, sizeof(tests)/sizeof(testfunc), dhcp_setup, dhcp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * ip6_suite(void) { testfunc tests[] = { TESTFUNC(test_ip6_ll_addr), TESTFUNC(test_ip6_aton_ipv4mapped), TESTFUNC(test_ip6_ntoa_ipv4mapped), TESTFUNC(test_ip6_ntoa), TESTFUNC(test_ip6_lladdr) }; return create_suite("IPv6", tests, sizeof(tests)/sizeof(testfunc), ip6_setup, ip6_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * dhcp_suite(void) { TFun tests[] = { test_dhcp, test_dhcp_nak, test_dhcp_relayed, test_dhcp_nak_no_endmarker }; return create_suite("DHCP", tests, sizeof(tests)/sizeof(TFun), dhcp_setup, dhcp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * tcp_suite(void) { testfunc tests[] = { TESTFUNC(test_tcp_new_abort), TESTFUNC(test_tcp_recv_inseq), TESTFUNC(test_tcp_fast_retx_recover), TESTFUNC(test_tcp_fast_rexmit_wraparound), TESTFUNC(test_tcp_rto_rexmit_wraparound), TESTFUNC(test_tcp_tx_full_window_lost_from_unacked), TESTFUNC(test_tcp_tx_full_window_lost_from_unsent) }; return create_suite("TCP", tests, sizeof(tests)/sizeof(testfunc), tcp_setup, tcp_teardown); }
END_TEST /** Create the suite including all tests for this module */ Suite * tcp_suite(void) { TFun tests[] = { test_tcp_new_abort, test_tcp_recv_inseq, test_tcp_fast_retx_recover, test_tcp_fast_rexmit_wraparound, test_tcp_rto_rexmit_wraparound, test_tcp_tx_full_window_lost_from_unacked, test_tcp_tx_full_window_lost_from_unsent }; return create_suite("TCP", tests, sizeof(tests)/sizeof(TFun), tcp_setup, tcp_teardown); }
} END_TEST static Suite * create_suite(void) { Suite *s = suite_create(__FILE__); TCase *tc_core = tcase_create("core"); tcase_add_test(tc_core, test_1); tcase_add_test(tc_core, test_2); suite_add_tcase(s, tc_core); return s; } int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) { int number_failed; Suite *s = create_suite(); SRunner *sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); number_failed = srunner_ntests_failed(sr); srunner_free(sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
Suite * sockets_suite(void) { return create_suite("SOCKETS", NULL, 0, NULL, NULL); }