Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNIT_TEST(irc_message)
- {
- irc_message_t *prefixed =
- irc_parse_message(":freyja.omegamatic.int 001 user :Welcome to Omegamatic IRC user");
- TEST(prefixed->parc == 2);
- TEST(!strcmp(prefixed->sender, "freyja.omegamatic.int"));
- TEST(!strcmp(prefixed->command, "001"));
- TEST(!strcmp(prefixed->command, prefixed->parv[0]));
- TEST(!strcmp(prefixed->parv[1], "user"));
- TEST(!strcmp(prefixed->parv[2], "Welcome to Omegamatic IRC user"));
- irc_destroy_message(prefixed);
- irc_message_t *prefixless =
- irc_parse_message("JOIN #channel");
- TEST(prefixless->parc == 1);
- TEST(prefixless->sender == NULL);
- TEST(!strcmp(prefixless->command, "JOIN"));
- TEST(!strcmp(prefixless->command, prefixless->parv[0]));
- TEST(!strcmp(prefixless->parv[1], "#channel"));
- irc_destroy_message(prefixless);
- }
Advertisement
Add Comment
Please, Sign In to add comment