1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

getVarType

This commit is contained in:
tg(x) 2011-04-29 22:58:19 +02:00
parent 6f9a753415
commit f722733f08
5 changed files with 112 additions and 28 deletions

View file

@ -1,7 +1,7 @@
CFLAGS=-I../include -DDEBUG -g -O0 -Wall
LDFLAGS=-L../src
LOADLIBES=-lpsyc -lm
TARGETS=testServer testParser testMatch testRender isRoutingVar
TARGETS=testServer testParser testMatch testRender isRoutingVar getVarType
PORT=4440
all: $(TARGETS)

21
test/getVarType.c Normal file
View file

@ -0,0 +1,21 @@
#include <psyc.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include "../include/psyc/lib.h"
int main() {
unless (psyc_getVarType(PSYC_C2ARG("_list"))) return 1;
unless (psyc_getVarType(PSYC_C2ARG("_list_foo"))) return 2;
unless (psyc_getVarType(PSYC_C2ARG("_color_red"))) return 3;
if (psyc_getVarType(PSYC_C2ARG("_last"))) return 4;
if (psyc_getVarType(PSYC_C2ARG("_lost_foo"))) return 5;
if (psyc_getVarType(PSYC_C2ARG("_colorful"))) return 6;
if (psyc_getVarType(PSYC_C2ARG("_foo"))) return 7;
if (psyc_getVarType(PSYC_C2ARG("bar"))) return 8;
if (psyc_getVarType(PSYC_C2ARG("______"))) return 9;
if (psyc_getVarType(PSYC_C2ARG("_"))) return 10;
puts("psyc_getVarType passed all tests.");
return 0; // passed all tests
}