Commit c7140cae authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added tests for tport_shutdown(). Do not assert() on invalid input.

darcs-hash:20050908181639-65a35-cbae3de5c04cb1e834c9835a8c9c870dc5e7e67d.gz
parent 660bda27
......@@ -2262,8 +2262,6 @@ void tport_close(tport_t *self)
*/
int tport_shutdown(tport_t *self, int how)
{
assert(self); assert(how >= 0 && how <= 2);
if (self == NULL || tport_is_primary(self))
return -1;
......
......@@ -875,6 +875,11 @@ static int reuse_test(tp_test_t *tt)
TEST(tport_test_run(tt, 5), 1);
msg_destroy(tt->tt_rmsg), tt->tt_rmsg = NULL;
TEST_1(tport_shutdown(tp0, 2) >= 0);
TEST_1(tport_shutdown(tp1, 2) >= 0);
TEST_1(tport_shutdown(tp0, 1) >= 0);
TEST(tport_shutdown(NULL, 0), -1);
tport_decref(&tp0);
tport_decref(&tp1);
......
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