added
[rrq/rrqmisc.git] / tests / relationtests.c
1 /**
2  * This is a collection of tests of the relation functions.
3  */
4 #include <stringitem.h>
5 #include <relation.h>
6
7 extern itemkeyfun tupleschema_callbacks;
8
9 int main(int argc,char **argv) {
10     tuple *data[] = {
11         TUPLE( "a", "b" ),
12         TUPLE( "a", "c" ),
13         TUPLE( "a", "d" ),
14     };
15     // AxB
16     relation rel2 = RELATION( &stringitem, &stringitem );
17
18     relation_add( &rel2, data[0] );
19
20     // AxBxC
21     relation rel3 = RELATION( &stringitem, &stringitem, &stringitem );
22     // AxB -> C
23     relation_add_constraint( &rel3, 1, 1, 0 );
24     // AxC -> B
25     relation_add_constraint( &rel3, 1, 0, 1 );
26
27     return 0;
28 }