2020-07-20 21:40:35 +00:00
|
|
|
#include "../include/uirc.h"
|
|
|
|
#include "stdio.h"
|
|
|
|
#include "stdlib.h"
|
|
|
|
#include "string.h"
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char mesg[513] = {0};
|
|
|
|
IRC_Message input = {
|
2020-07-23 13:59:41 +00:00
|
|
|
#ifdef UIRC_IRCV3
|
|
|
|
.tags = {
|
|
|
|
.msgid = {.value = "10"}},
|
|
|
|
#endif
|
|
|
|
.name = {.nick = "dad", .user = "dad-door", .host = "home.localhost"},
|
2020-07-20 21:40:35 +00:00
|
|
|
.cmd = PRIVMSG,
|
|
|
|
.args = {"(You)"},
|
|
|
|
.trailing = "are ya winning son?",
|
|
|
|
};
|
|
|
|
int res;
|
|
|
|
if ((res = Assm_mesg(mesg, &input, 512)) <= 0) {
|
|
|
|
printf("Failed to assemble message. (%i)\n", res);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-07-23 13:59:41 +00:00
|
|
|
char* expect =
|
|
|
|
#ifdef UIRC_IRCV3
|
|
|
|
"@msgid=10 "
|
|
|
|
#endif
|
|
|
|
":dad!dad-door@home.localhost PRIVMSG (You) :are ya winning son?\r\n";
|
2020-07-20 21:40:35 +00:00
|
|
|
if (strcmp(expect, mesg)) {
|
|
|
|
printf("Assembled message mismatch.\nGot:\n%s\nbut expected:\n%s\n", mesg, expect);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|