1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00
libpsyc/test/method.c
2012-01-09 11:52:09 +01:00

29 lines
704 B
C

#include <psyc.h>
#include <stdio.h>
#include <lib.h>
int main()
{
PsycMethod family = 0;
unsigned int flag = 0;
int i;
for (i = 0; i < psyc_methods_num; i++)
if (psyc_method(PSYC_S2ARG(psyc_methods[i].key), &family, &flag)
!= psyc_methods[i].value)
return i + 1;
if (psyc_method(PSYC_C2ARG("_echo_hallo"), &family, &flag) != PSYC_MC_UNKNOWN
&& family != PSYC_MC_ECHO)
return 101;
if (psyc_method(PSYC_C2ARG("_foo_bar"), &family, &flag) != PSYC_MC_UNKNOWN)
return 102;
if (psyc_method(PSYC_C2ARG("_warning_test"), &family, &flag) != PSYC_MC_WARNING
&& family != PSYC_MC_WARNING)
return 103;
printf("psyc_method passed all tests.\n");
return 0;
}