7 #include "../src/semtable.h"
8 #include "../src/receptor.h"
13 spec_is_equal(sem->contexts,0);
14 int idx = _sem_new_context(sem,(
T *)1234
L);
16 spec_is_equal(sem->contexts,1);
17 Symbol s = {SYS_CONTEXT,0,0};
18 spec_is_long_equal((
long)_sem_context(sem,s)->definitions,1234
L);
25 spec_is_str_equal(
_sem_get_name(G_sem,TEST_INT_SYMBOL),
"TEST_INT_SYMBOL");
26 spec_is_str_equal(
_sem_get_name(G_sem,NULL_SYMBOL),
"NULL_SYMBOL");
27 spec_is_str_equal(
_sem_get_name(G_sem,NULL_STRUCTURE),
"NULL_STRUCTURE");
28 spec_is_str_equal(
_sem_get_name(G_sem,NULL_PROCESS),
"NULL_PROCESS");
29 spec_is_str_equal(
_sem_get_name(G_sem,DEFINITIONS),
"DEFINITIONS");
37 spec_is_str_equal(t2s(
_sem_get_label(G_sem,CONTENT_TYPE,HTTP_HEADER_LABEL)),
"(HTTP_HEADER_LABEL:Content-Type)");
38 spec_is_str_equal(t2s(
_sem_get_label(G_sem,CONTENT_TYPE,TEST_SYMBOL_SYMBOL)),
"(ENGLISH_LABEL:CONTENT_TYPE)");
44 spec_is_structure_equal(0,_sem_get_symbol_structure(G_sem,STRUCTURE_DEFINITION),TUPLE_OF_STRUCTURE_LABEL_AND_STRUCTURE_DEF);
45 spec_is_structure_equal(0,_sem_get_symbol_structure(G_sem,STRUCTURE_SYMBOL),SYMBOL);
54 spec_is_true(__sem_get_by_label(G_sem,
"DEFINITIONS",&s,SYS_CONTEXT));
55 spec_is_sem_equal(s,DEFINITIONS);
56 spec_is_false(__sem_get_by_label(G_sem,
"DEFINITIONS",&s,INTERNET_CONTEXT));
58 spec_is_true(_sem_get_by_label(G_sem,
"OCTET_STREAM",&s));
59 spec_is_sem_equal(s,OCTET_STREAM);
60 spec_is_true(semeq(s,OCTET_STREAM));
62 spec_is_false(_sem_get_by_label(G_sem,
"non existent symbol",&s));
70 spec_is_str_equal(t2s(_sem_get_def(G_sem,BIT)),
"(STRUCTURE_DEFINITION (STRUCTURE_LABEL (ENGLISH_LABEL:BIT) (ASCII_STR:one or zero)) (STRUCTURE_SYMBOL:NULL_SYMBOL))");
char * _sem_get_name(SemTable *sem, SemanticID s)
void testSemTableGetLabel()
T * _sem_get_label(SemTable *sem, SemanticID s, Symbol label_type)
void testSemTableGetName()
void testSemTableCreate()
void testSemGetSymbolStructure()
void _sem_add_label(SemTable *sem, SemanticID s, Symbol label_type, char *label)