| 62 | "MATCH (p:Person)-[ef:friend]->(f:Person)-[ev:visit]->(c:City)-[ew:war]->(e:City) RETURN ew"; |
| 63 | |
| 64 | static void _fake_graph_context() { |
| 65 | GraphContext *gc = (GraphContext *)calloc(1, sizeof(GraphContext)); |
| 66 | |
| 67 | gc->g = Graph_New(16, 16); |
| 68 | |
| 69 | gc->ref_count = 1; |
| 70 | gc->index_count = 0; |
| 71 | gc->graph_name = strdup("G"); |
| 72 | gc->attributes = raxNew(); |
| 73 | gc->string_mapping = (char**)array_new(char*, 64); |
| 74 | gc->node_schemas = (Schema**)array_new(Schema*, GRAPH_DEFAULT_LABEL_CAP); |
| 75 | gc->relation_schemas = (Schema**)array_new(Schema*, GRAPH_DEFAULT_RELATION_TYPE_CAP); |
| 76 | gc->queries_log = QueriesLog_New(); |
| 77 | |
| 78 | pthread_rwlock_init(&gc->_attribute_rwlock, NULL); |
| 79 | |
| 80 | GraphContext_AddSchema(gc, "Person", SCHEMA_NODE); |
| 81 | GraphContext_AddSchema(gc, "City", SCHEMA_NODE); |
| 82 | GraphContext_AddSchema(gc, "friend", SCHEMA_EDGE); |
| 83 | GraphContext_AddSchema(gc, "visit", SCHEMA_EDGE); |
| 84 | GraphContext_AddSchema(gc, "war", SCHEMA_EDGE); |
| 85 | |
| 86 | TEST_ASSERT(QueryCtx_Init()); |
| 87 | QueryCtx_SetGraphCtx(gc); |
| 88 | } |
| 89 | |
| 90 | /* Create a graph containing: |
| 91 | * Entities: 'people' and 'countries'. |
no test coverage detected