diff options
Diffstat (limited to 'tests/unit/plugins/irc')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 037feeb9e..777012992 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -46,7 +46,8 @@ extern const char *irc_protocol_nick_address (struct t_irc_server *server, struct t_irc_nick *nick, const char *nickname, const char *address); -extern char *irc_protocol_string_params (const char **params, int start_arg); +extern char *irc_protocol_string_params (const char **params, + int arg_start, int arg_end); extern char *irc_protocol_cap_to_enable (const char *capabilities, int sasl_requested); } @@ -320,27 +321,30 @@ TEST(IrcProtocol, StringParams) const char *params_3[] = { "param1", "param2", "param3", NULL }; /* invalid arguments */ - WEE_TEST_STR("", irc_protocol_string_params (NULL, -1)); - WEE_TEST_STR("", irc_protocol_string_params (NULL, 0)); + WEE_TEST_STR("", irc_protocol_string_params (NULL, -1, -1)); + WEE_TEST_STR("", irc_protocol_string_params (NULL, 0, 0)); + WEE_TEST_STR("", irc_protocol_string_params (NULL, 0, -1)); + WEE_TEST_STR("", irc_protocol_string_params (params_1, 1, 0)); /* empty parameter */ - WEE_TEST_STR("", irc_protocol_string_params (params_empty, 0)); - WEE_TEST_STR("", irc_protocol_string_params (params_empty, 1)); + WEE_TEST_STR("", irc_protocol_string_params (params_empty, 0, 0)); + WEE_TEST_STR("", irc_protocol_string_params (params_empty, 1, 1)); /* one parameter */ - WEE_TEST_STR("param1", irc_protocol_string_params (params_1, 0)); - WEE_TEST_STR("", irc_protocol_string_params (params_1, 1)); + WEE_TEST_STR("param1", irc_protocol_string_params (params_1, 0, 0)); + WEE_TEST_STR("", irc_protocol_string_params (params_1, 1, 1)); /* two parameters */ - WEE_TEST_STR("param1 param2", irc_protocol_string_params (params_2, 0)); - WEE_TEST_STR("param2", irc_protocol_string_params (params_2, 1)); - WEE_TEST_STR("", irc_protocol_string_params (params_2, 2)); + WEE_TEST_STR("param1 param2", irc_protocol_string_params (params_2, 0, 1)); + WEE_TEST_STR("param2", irc_protocol_string_params (params_2, 1, 1)); + WEE_TEST_STR("", irc_protocol_string_params (params_2, 2, 2)); /* three parameters */ - WEE_TEST_STR("param1 param2 param3", irc_protocol_string_params (params_3, 0)); - WEE_TEST_STR("param2 param3", irc_protocol_string_params (params_3, 1)); - WEE_TEST_STR("param3", irc_protocol_string_params (params_3, 2)); - WEE_TEST_STR("", irc_protocol_string_params (params_3, 3)); + WEE_TEST_STR("param1 param2 param3", irc_protocol_string_params (params_3, 0, 2)); + WEE_TEST_STR("param2 param3", irc_protocol_string_params (params_3, 1, 2)); + WEE_TEST_STR("param2", irc_protocol_string_params (params_3, 1, 1)); + WEE_TEST_STR("param3", irc_protocol_string_params (params_3, 2, 2)); + WEE_TEST_STR("", irc_protocol_string_params (params_3, 3, 3)); } TEST_GROUP(IrcProtocolWithServer) |