Fix all customization tests
This commit is contained in:
		
							parent
							
								
									b085add973
								
							
						
					
					
						commit
						e902ab4693
					
				@ -3,6 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "customizer/cell_customizer.hpp"
 | 
					#include "customizer/cell_customizer.hpp"
 | 
				
			||||||
#include "partition/multi_level_partition.hpp"
 | 
					#include "partition/multi_level_partition.hpp"
 | 
				
			||||||
 | 
					#include "partition/multi_level_graph.hpp"
 | 
				
			||||||
#include "util/static_graph.hpp"
 | 
					#include "util/static_graph.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace osrm;
 | 
					using namespace osrm;
 | 
				
			||||||
@ -19,7 +20,7 @@ struct MockEdge
 | 
				
			|||||||
    EdgeWeight weight;
 | 
					    EdgeWeight weight;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
auto makeGraph(const std::vector<MockEdge> &mock_edges)
 | 
					auto makeGraph(const MultiLevelPartition &mlp, const std::vector<MockEdge> &mock_edges)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    struct EdgeData
 | 
					    struct EdgeData
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -37,7 +38,7 @@ auto makeGraph(const std::vector<MockEdge> &mock_edges)
 | 
				
			|||||||
        edges.push_back(Edge{m.target, m.start, m.weight, false, true});
 | 
					        edges.push_back(Edge{m.target, m.start, m.weight, false, true});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    std::sort(edges.begin(), edges.end());
 | 
					    std::sort(edges.begin(), edges.end());
 | 
				
			||||||
    return util::StaticGraph<EdgeData>(max_id + 1, edges);
 | 
					    return partition::MultiLevelGraph<EdgeData, false>(mlp, max_id + 1, edges);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -53,7 +54,7 @@ BOOST_AUTO_TEST_CASE(two_level_test)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    std::vector<MockEdge> edges = {{0, 1, 1}, {0, 2, 1}, {2, 3, 1}, {3, 1, 1}, {3, 2, 1}};
 | 
					    std::vector<MockEdge> edges = {{0, 1, 1}, {0, 2, 1}, {2, 3, 1}, {3, 1, 1}, {3, 2, 1}};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto graph = makeGraph(edges);
 | 
					    auto graph = makeGraph(mlp, edges);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CellStorage storage(mlp, graph);
 | 
					    CellStorage storage(mlp, graph);
 | 
				
			||||||
    CellCustomizer customizer(mlp);
 | 
					    CellCustomizer customizer(mlp);
 | 
				
			||||||
@ -130,7 +131,7 @@ BOOST_AUTO_TEST_CASE(four_levels_test)
 | 
				
			|||||||
        {14, 11, 1} // edge between cells (2, 1, 0) -> (0, 0, 0)
 | 
					        {14, 11, 1} // edge between cells (2, 1, 0) -> (0, 0, 0)
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto graph = makeGraph(edges);
 | 
					    auto graph = makeGraph(mlp, edges);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CellStorage storage(mlp, graph);
 | 
					    CellStorage storage(mlp, graph);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user