2011-04-22 15:09:32 +00:00
|
|
|
#include <psyc.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
2011-04-25 21:58:07 +00:00
|
|
|
#include "../include/psyc/lib.h"
|
2011-04-22 15:09:32 +00:00
|
|
|
|
2011-04-25 21:58:07 +00:00
|
|
|
int main() {
|
|
|
|
#if 0
|
2011-04-25 12:20:13 +00:00
|
|
|
const char* vars[] =
|
2011-04-22 15:09:32 +00:00
|
|
|
{
|
|
|
|
"_source",
|
|
|
|
"_source_relay",
|
|
|
|
"_source_foo",
|
|
|
|
"_sourcherry",
|
|
|
|
"_foo",
|
|
|
|
"bar",
|
|
|
|
"_",
|
|
|
|
};
|
|
|
|
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < sizeof(vars) / sizeof(*vars); i++)
|
|
|
|
{
|
2011-04-25 21:40:38 +00:00
|
|
|
printf(">> %s: %d %d\n", vars[i], sizeof(vars[i]), sizeof(*vars[i]));
|
|
|
|
printf("%s: %d\n", vars[i], psyc_isRoutingVar(vars[i], strlen(vars[i])));
|
2011-04-22 15:09:32 +00:00
|
|
|
}
|
2011-04-25 21:58:07 +00:00
|
|
|
#else
|
|
|
|
unless (psyc_isRoutingVar(PSYC_C2ARG("_source"))) return -1;
|
|
|
|
unless (psyc_isRoutingVar(PSYC_C2ARG("_source_relay"))) return -2;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("_source_foo"))) return -3;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("_sourcherry"))) return -4;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("_sour"))) return -5;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("_foo"))) return -6;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("bar"))) return -7;
|
|
|
|
if (psyc_isRoutingVar(PSYC_C2ARG("_"))) return -8;
|
2011-04-22 15:09:32 +00:00
|
|
|
|
2011-04-25 21:58:07 +00:00
|
|
|
puts("psyc_isRoutingVar passed all tests.");
|
|
|
|
#endif
|
|
|
|
return 0; // passed all tests
|
2011-04-22 15:09:32 +00:00
|
|
|
}
|