tests: add tests on function irc_protocol_cb_part
parent
cecbad1803
commit
b82a887f2a
|
@ -634,6 +634,37 @@ TEST(IrcProtocolWithServer, nick)
|
|||
STRCMP_EQUAL("bob2", ptr_nick2->name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests functions:
|
||||
* irc_protocol_cb_part
|
||||
*/
|
||||
|
||||
TEST(IrcProtocolWithServer, part)
|
||||
{
|
||||
server_recv (":server 001 alice");
|
||||
|
||||
POINTERS_EQUAL(NULL, ptr_server->channels);
|
||||
|
||||
server_recv (":alice!user@host JOIN #test");
|
||||
|
||||
/* not enough arguments */
|
||||
server_recv (":alice!user@host PART");
|
||||
STRCMP_EQUAL("#test", ptr_server->channels->name);
|
||||
CHECK(ptr_server->channels->nicks);
|
||||
LONGS_EQUAL(0, ptr_server->channels->part);
|
||||
|
||||
/* channel not found */
|
||||
server_recv (":alice!user@host PART #xyz");
|
||||
STRCMP_EQUAL("#test", ptr_server->channels->name);
|
||||
CHECK(ptr_server->channels->nicks);
|
||||
LONGS_EQUAL(0, ptr_server->channels->part);
|
||||
|
||||
server_recv (":alice!user@host PART #test");
|
||||
STRCMP_EQUAL("#test", ptr_server->channels->name);
|
||||
POINTERS_EQUAL(NULL, ptr_server->channels->nicks);
|
||||
LONGS_EQUAL(1, ptr_server->channels->part);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests functions:
|
||||
* irc_protocol_cb_001 (empty)
|
||||
|
|
Loading…
Reference in New Issue