Commit e9cfc935 authored by Pekka Pessi's avatar Pekka Pessi

test_tport.c: fixed problem in queueing test.

The test failed if all the queued messages were read within a single "IN"
event and a single recv() call. Now increasing the size of queued messages
and checking if all the queued messages are read with a single recv(), too.

darcs-hash:20060808132812-65a35-f7343bc21061b5e80e0a5a8133d1ade2bae62f6e.gz
parent a139e88e
......@@ -798,7 +798,7 @@ static int tcp_test(tp_test_t *tt)
for (i = 1; i < TPORT_QUEUESIZE; i++) {
snprintf(ident, sizeof ident, "tcp-%u", i);
TEST(new_test_msg(tt, &msg, ident, 1, 1024), 0);
TEST(new_test_msg(tt, &msg, ident, 1, 64 * 1024), 0);
TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, TAG_END()));
TEST_S(tport_name(tp)->tpn_ident, "client");
TEST(tport_incref(tp), tp0); tport_decref(&tp);
......@@ -817,10 +817,12 @@ static int tcp_test(tp_test_t *tt)
test_check_md5(tt, tt->tt_rmsg);
msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
snprintf(ident, sizeof ident, "tcp-%u", tt->tt_received);
TEST(tport_test_run(tt, 5), 1);
TEST_1(!check_msg(tt, tt->tt_rmsg, ident));
msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
if (tt->tt_received < TPORT_QUEUESIZE) { /* We have not received it all */
snprintf(ident, sizeof ident, "tcp-%u", tt->tt_received);
TEST(tport_test_run(tt, 5), 1);
TEST_1(!check_msg(tt, tt->tt_rmsg, ident));
msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
}
/* This uses a new connection */
TEST_1(!new_test_msg(tt, &msg, "tcp-no-reuse", 1, 1024));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment