27 lines
577 B
C
27 lines
577 B
C
#include "../include/uirc.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(void)
|
|
{
|
|
char mesg[513] = {0};
|
|
IRC_Message input = {
|
|
.cmd = RPL_WELCOME,
|
|
.args = {"hello", NULL},
|
|
.trailing = true,
|
|
};
|
|
int res;
|
|
if ((res = Assm_mesg(mesg, &input, 512)) <= 0) {
|
|
printf("Failed to assemble message. (%i)\n", res);
|
|
return EXIT_FAILURE;
|
|
}
|
|
char* expect =
|
|
"001 :hello\r\n";
|
|
if (strcmp(expect, mesg)) {
|
|
printf("Assembled message mismatch.\nGot:\n%s\nbut expected:\n%s\n", mesg, expect);
|
|
return EXIT_FAILURE;
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|