38#include <gtest/gtest.h>
39#include "../tpl_indexNode.H"
41#include "../tpl_graph.H"
59 return p1->get_info().id < p2->get_info().id;
78 auto*
node1 = index.insert_in_graph({1,
"A"});
89 index.insert_in_graph({1,
"A"});
95 auto*
node1 = index.insert_in_graph({1,
"A"});
96 index.insert_in_graph({2,
"B"});
102 EXPECT_EQ(index.search({1,
""}),
nullptr);
103 EXPECT_NE(index.search({2,
""}),
nullptr);
107 auto*
node1 = index.insert_in_graph({1,
"A"});
108 index.insert_in_graph({2,
"B"});
112 index.remove_from_graph(
node1);
115 EXPECT_EQ(index.search({1,
""}),
nullptr);
119 auto*
node1 = g.insert_node({1,
"A"});
125 g.insert_node({10,
"X"});
126 g.insert_node({20,
"Y"});
135 g.insert_node({30,
"Z"});
142 index.insert_in_graph({1,
"A"});
143 index.insert_in_graph({2,
"B"});
153 index.insert_in_graph({1,
"A"});
154 index.insert_in_graph({2,
"B"});
size_t size() const noexcept
Count the number of elements of the list.
Builds an index of nodes for fast search and retrieval.
_Graph_Node Node
The graph type.
Aleph::IndexNode< TestGraph, TestNodeCmp > index
TEST_F(IndexNodeTest, InitialState)
DynList< T > maps(const C &c, Op op)
Classic map operation.
Arc of graph implemented with double-linked adjacency lists.
bool operator()(const TestGraph::Node *p1, const TestGraph::Node *p2) const
bool operator<(const TestNodeData &other) const