12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include "test.h"
- #include "namespace.h"
- static int
- test_desc_create()
- {
- char
- *ttl1 = "<urn:s:1> <urn:p:2> <urn:o:2> , <urn:o:1> ; "
- "<urn:p:1> <urn:o:1> . "
- "<urn:s:2> <urn:p:1> <urn:o:1> . ",
- *ttl2 = "<urn:s:20> <urn:p:10> <urn:o:10> . "
- "<urn:s:10> <urn:p:10> <urn:o:10> ; "
- "<urn:p:20> <urn:o:20> , <urn:o:10> . ";
- 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;
- }
|