Commit 70bbb9bd authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add test with string as index, OK

parent a684216a
......@@ -7,4 +7,5 @@ add_subdirectory(TEST_DOT)
add_executable(test_graph_to_dot_str main.cpp)
add_test(NAME TestGraphToDotStr
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_graph_to_dot_str)
Auteur : Pierre Aubert
Mail :
Licence : CeCILL-C
#include "Graph.h"
///Test the graph conversion to dot
void testGraphToDot(){
Graph<bool, std::string> graph;
std::string nodeA("a");
std::string nodeB("b");
std::string nodeC("c");
std::string nodeD("d");
std::string nodeE("e");
//The first parameter is the data, second is the index and the third is the name
graph.createNode(true, nodeA, "var_" + nodeA);
graph.createNode(true, nodeB, "var_" + nodeB);
graph.createNode(true, nodeC, "var_" + nodeC);
graph.createNode(true, nodeD, "var_" + nodeD);
graph.createNode(true, nodeE, "var_" + nodeE);
graph.connectNode(nodeA, nodeC);
graph.connectNode(nodeB, nodeC);
graph.connectNode(nodeC, nodeE);
graph.connectNode(nodeD, nodeE);
int main(int argc, char** argv){
return 0;
Auteur : Pierre Aubert
Mail :
Licence : CeCILL-C
#include "list_index_utils.h"
///Remove index from listIndex
/** @param[out] listIndex : list of index to be modified
* @param index : index to be removed from list of index
template<typename UIdx>
void listindex_remove(std::list<UIdx> & listIndex, UIdx index){
if(listIndex.size() == 0lu){return;}
typename std::list<UIdx>::iterator it(listIndex.begin());
while(it != listIndex.end()){
if(*it == index){
it = listIndex.erase(it);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment