|
@@ -49,12 +49,11 @@ _graph_add (LSUP_StoreType type)
|
|
|
|
|
|
LSUP_Graph *gr;
|
|
|
LSUP_Store *store;
|
|
|
- if (type == LSUP_STORE_HTABLE) {
|
|
|
- gr = LSUP_graph_new (NULL, NULL, NULL);
|
|
|
- } else {
|
|
|
- store = LSUP_store_new (type, NULL, 0);
|
|
|
- gr = LSUP_graph_new (store, NULL, NULL);
|
|
|
- }
|
|
|
+
|
|
|
+ if (type = LSUP_STORE_HTABLE) store = NULL;
|
|
|
+ else store = LSUP_store_new (type, NULL, 0);
|
|
|
+
|
|
|
+ gr = LSUP_graph_new (store, NULL, NULL);
|
|
|
ASSERT (gr != NULL, "Error creating graph!");
|
|
|
|
|
|
size_t ct;
|
|
@@ -75,6 +74,15 @@ _graph_add (LSUP_StoreType type)
|
|
|
|
|
|
free_triples (trp); // gr copied data.
|
|
|
|
|
|
+ // Check size again after freeing triples.
|
|
|
+ EXPECT_INT_EQ (LSUP_graph_size (gr), 8);
|
|
|
+
|
|
|
+ LSUP_Graph *gr2 = LSUP_graph_new (NULL, NULL, NULL);
|
|
|
+
|
|
|
+ // Test equality against empty graph.
|
|
|
+ ASSERT (!LSUP_graph_equals (gr, gr2), "Graphs should not be equal!");
|
|
|
+ ASSERT (!LSUP_graph_equals (gr2, gr), "Graphs should not be equal!");
|
|
|
+
|
|
|
LSUP_graph_free (gr);
|
|
|
if (type != LSUP_STORE_HTABLE) LSUP_store_free (store);
|
|
|
|