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
|
|
|
|
|
|
|
#define cmd "QUIT"
|
|
|
|
#define arg1 "arg1"
|
|
|
|
#define arg2 "arg2"
|
|
|
|
#define trailing "Finished!"
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char mesg[513] = cmd " " arg1 " " arg2 " :" trailing;
|
|
|
|
IRC_Message parseout;
|
|
|
|
int res = 0;
|
|
|
|
if ((res = Tok_mesg(mesg, &parseout)) <= 0) {
|
|
|
|
printf("String could not be tokenized. %i\n", res);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
if (strcmp(parseout.args[0], arg1)) {
|
|
|
|
printf("Arg1 didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[0], arg1);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
if (strcmp(parseout.args[1], arg2)) {
|
|
|
|
printf("Arg2 didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[1], arg2);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
if (strcmp(parseout.args[2], trailing)) {
|
|
|
|
printf("Trailing didn't match, got \"%s\" instead of \"%s\"\n", parseout.args[2], trailing);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|