#include "test.h" #include "namespace.h" static int test_desc_create() { char *ttl1 = " , ; " " . " " . ", *ttl2 = " . " " ; " " , . "; LSUP_Graph *data[3] = {NULL}; FILE *input; char *err; size_t ct; input = fmemopen (ttl1, strlen (ttl1), "r"); ttl_codec.decode_graph(input, data, &ct, &err); LSUP_graph_set_uri (data[0], LSUP_iriref_new ("#usr1", NULL)); fclose(input); input = fmemopen (ttl2, strlen (ttl2), "r"); ttl_codec.decode_graph(input, data + 1, &ct, &err); LSUP_graph_set_uri (data[1], LSUP_iriref_new ("#usr2", NULL)); fclose(input); free(err); LSR_Desc *rsrc; EXPECT_PASS (LSR_desc_new_multi (data, &rsrc)); // Free input handles before using the resource to ensure that these // pointers are not being referenced by the resource. LSUP_graph_free (data[0]); LSUP_graph_free (data[1]); // TODO tests: // * Existence of admin graph // * Existence of main graph // * Linkage of admin and main graphs // * Existence of user graphs // * Linkage of user graphs // * Size of user graphs // * Spot-test triples in user graphs // Store for next test before freeing. EXPECT_PASS (LSR_desc_store (rsrc)); LSR_desc_free (rsrc); return 0; } static int test_desc_get () { return 0; } int desc_tests() { RUN (test_desc_create); RUN (test_desc_get); return 0; }