This repository has been archived on 2021-04-17. You can view files and clone it, but cannot push or open issues or pull requests.
2020-08-18 19:20:45 +00:00
|
|
|
#include "../include/uirc.h"
|
2020-09-01 09:49:37 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2020-08-18 19:20:45 +00:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char mesg[513] = {0};
|
|
|
|
IRC_Message input = {
|
|
|
|
.cmd = RPL_WELCOME,
|
|
|
|
.args = {"hello", NULL},
|
|
|
|
.trailing = true,
|
|
|
|
};
|
2020-10-02 12:40:15 +00:00
|
|
|
signed long res;
|
2020-08-18 19:20:45 +00:00
|
|
|
if ((res = Assm_mesg(mesg, &input, 512)) <= 0) {
|
2020-10-02 12:40:15 +00:00
|
|
|
printf("Failed to assemble message. (%li)\n", res);
|
2020-08-18 19:20:45 +00:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-10-10 10:30:05 +00:00
|
|
|
char* expect = "001 :hello\r\n";
|
2020-10-02 12:40:15 +00:00
|
|
|
if (strcmp(expect, mesg) != 0) {
|
2020-08-18 19:20:45 +00:00
|
|
|
printf("Assembled message mismatch.\nGot:\n%s\nbut expected:\n%s\n", mesg, expect);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
2020-10-02 12:40:15 +00:00
|
|
|
|