Exemplo n.º 1
0
void test_listener() {
    mu_run(test_parse_empty_message);
    mu_run(test_parse);
    mu_run(test_parse_with_prefix);
    mu_run(test_parse_with_last_param);
    mu_run(test_parse_with_prefix_and_last_param);
    mu_run(test_parse_only_last_param);
    mu_run(test_parse_with_prefix_only_last_param);
}
Exemplo n.º 2
0
void test_irc() {
    int socks[2];

    mu_run(test_shutdown_handler);
    mu_run(test_bnd_bind);
    mu_run(test_bnd_unbind);
    mu_run(test_bind_command);
    mu_run(test_unbind_command);

    /* Mock the socket used to test the IRC messages */
    if (socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1) {
        perror("socketpair error");
        exit(EXIT_FAILURE);
    }

    _socket = socks[0];
    mock_socket = fdopen(socks[1], "r");

    mu_run(test_irc_nick);
    mu_run(test_irc_user);
    mu_run(test_irc_quit);
    mu_run(test_irc_join);
    mu_run(test_irc_join_pass);
    mu_run(test_irc_part);
    mu_run(test_irc_topic);
    mu_run(test_irc_names);
    mu_run(test_irc_list);
    mu_run(test_irc_invite);
    mu_run(test_irc_message);
    mu_run(test_irc_message);
    mu_run(test_irc_op);
    mu_run(test_irc_deop);
    mu_run(test_irc_voice);
    mu_run(test_irc_devoice);
    mu_run(test_irc_kick);
    mu_run(test_irc_ban);
    mu_run(test_irc_unban);
    mu_run(test_irc_ban_list);
    mu_run(test_irc_limit);
    mu_run(test_irc_channel_key);
    mu_run(test_irc_channel_set);
    mu_run(test_irc_channel_unset);
    mu_run(test_irc_user_set);
    mu_run(test_irc_user_unset);
    mu_run(test_irc_pong);
    mu_run(test_irc_raw);

    close(socks[0]);
    close(socks[1]);
}
Exemplo n.º 3
0
static mu_test tests() 
{
	mu_run(test_prng_seed);
	mu_run(complex_seed);
	return 0;
}