summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index e0be0ef0a..1ca8b7706 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -306,6 +306,10 @@ TEST(IrcProtocolWithServer, account_without_account_notify_cap)
POINTERS_EQUAL(NULL, ptr_nick->account);
+ /* not enough arguments */
+ server_recv (":alice!user@host ACCOUNT");
+ POINTERS_EQUAL(NULL, ptr_nick->account);
+
server_recv (":alice!user@host ACCOUNT *");
POINTERS_EQUAL(NULL, ptr_nick->account);
@@ -379,6 +383,11 @@ TEST(IrcProtocolWithServer, chghost)
STRCMP_EQUAL("user@host", ptr_nick->host);
+ /* not enough arguments */
+ server_recv (":alice!user@host CHGHOST");
+ server_recv (":alice!user@host CHGHOST user2");
+ STRCMP_EQUAL("user@host", ptr_nick->host);
+
server_recv (":alice!user@host CHGHOST user2 host2");
STRCMP_EQUAL("user2@host2", ptr_nick->host);
@@ -400,6 +409,10 @@ TEST(IrcProtocolWithServer, join)
POINTERS_EQUAL(NULL, ptr_server->channels);
+ /* not enough arguments */
+ server_recv (":alice!user@host JOIN");
+ POINTERS_EQUAL(NULL, ptr_server->channels);
+
server_recv (":alice!user@host JOIN #test");
ptr_channel = ptr_server->channels;
@@ -463,6 +476,11 @@ TEST(IrcProtocolWithServer, kick)
CHECK(ptr_channel->nicks->next_nick);
STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name);
+ /* not enough arguments */
+ server_recv (":alice!user@host KICK");
+ server_recv (":alice!user@host KICK #test");
+ STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name);
+
server_recv (":alice!user@host KICK #test bob :no spam here!");
STRCMP_EQUAL("alice", ptr_channel->nicks->name);
@@ -493,6 +511,10 @@ TEST(IrcProtocolWithServer, kill)
CHECK(ptr_channel->nicks->next_nick);
STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name);
+ /* not enough arguments */
+ server_recv (":alice!user@host KILL");
+ STRCMP_EQUAL("bob", ptr_channel->nicks->next_nick->name);
+
server_recv (":alice!user@host KILL bob :killed by admin");
STRCMP_EQUAL("alice", ptr_channel->nicks->name);
@@ -524,9 +546,10 @@ TEST(IrcProtocolWithServer, mode)
STRCMP_EQUAL(" ", ptr_nick->prefixes);
STRCMP_EQUAL(" ", ptr_nick->prefix);
- /* missing arguments */
+ /* not enough arguments */
server_recv (":admin MODE");
server_recv (":admin MODE #test");
+ POINTERS_EQUAL(NULL, ptr_channel->modes);
/* channel mode */
server_recv (":admin MODE #test +nt");
@@ -589,6 +612,8 @@ TEST(IrcProtocolWithServer, nick)
/* not enough arguments */
server_recv (":alice!user@host NICK");
+ STRCMP_EQUAL("alice", ptr_nick1->name);
+ STRCMP_EQUAL("bob", ptr_nick2->name);
/* new nick for alice */
server_recv (":alice!user@host NICK alice_away");