From bcd73e604c21d3a52df7a202ce3eb5067371f4a8 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 22 Jan 2015 17:00:48 +0100 Subject: [PATCH] reformat coordinate and rtree test code --- unit_tests/data_structures/coordinate.cpp | 3 +- unit_tests/data_structures/static_rtree.cpp | 49 +++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/unit_tests/data_structures/coordinate.cpp b/unit_tests/data_structures/coordinate.cpp index 6569e2f4b..b371368be 100644 --- a/unit_tests/data_structures/coordinate.cpp +++ b/unit_tests/data_structures/coordinate.cpp @@ -44,8 +44,7 @@ BOOST_AUTO_TEST_CASE(regression_test_1347) float ratio; FixedPointCoordinate nearest_location; - float d2 = - coordinate_calculation::perpendicular_distance(u, v, q, nearest_location, ratio); + float d2 = coordinate_calculation::perpendicular_distance(u, v, q, nearest_location, ratio); BOOST_CHECK_LE(std::abs(d1 - d2), 0.01f); } diff --git a/unit_tests/data_structures/static_rtree.cpp b/unit_tests/data_structures/static_rtree.cpp index a4c21606c..1e2676b4e 100644 --- a/unit_tests/data_structures/static_rtree.cpp +++ b/unit_tests/data_structures/static_rtree.cpp @@ -260,17 +260,17 @@ struct GraphFixture }; typedef RandomGraphFixture -TestRandomGraphFixture_LeafHalfFull; + TestRandomGraphFixture_LeafHalfFull; typedef RandomGraphFixture -TestRandomGraphFixture_LeafFull; + TestRandomGraphFixture_LeafFull; typedef RandomGraphFixture -TestRandomGraphFixture_TwoLeaves; + TestRandomGraphFixture_TwoLeaves; typedef RandomGraphFixture -TestRandomGraphFixture_Branch; + TestRandomGraphFixture_Branch; typedef RandomGraphFixture -TestRandomGraphFixture_MultipleLevels; + TestRandomGraphFixture_MultipleLevels; template void simple_verify_rtree(RTreeT &rtree, @@ -286,11 +286,11 @@ void simple_verify_rtree(RTreeT &rtree, bool found_u = rtree.LocateClosestEndPointForCoordinate(pu, result_u, 1); bool found_v = rtree.LocateClosestEndPointForCoordinate(pv, result_v, 1); BOOST_CHECK(found_u && found_v); - float dist_u = coordinate_calculation::euclidean_distance( - result_u.lat, result_u.lon, pu.lat, pu.lon); + float dist_u = + coordinate_calculation::euclidean_distance(result_u.lat, result_u.lon, pu.lat, pu.lon); BOOST_CHECK_LE(dist_u, std::numeric_limits::epsilon()); - float dist_v = coordinate_calculation::euclidean_distance( - result_v.lat, result_v.lon, pv.lat, pv.lon); + float dist_v = + coordinate_calculation::euclidean_distance(result_v.lat, result_v.lon, pv.lat, pv.lon); BOOST_CHECK_LE(dist_v, std::numeric_limits::epsilon()); } } @@ -389,30 +389,31 @@ BOOST_AUTO_TEST_CASE(regression_test) { typedef std::pair Coord; typedef std::pair Edge; - GraphFixture fixture({ - Coord(40.0, 0.0), - Coord(35.0, 5.0), + GraphFixture fixture( + { + Coord(40.0, 0.0), + Coord(35.0, 5.0), - Coord(5.0, 5.0), - Coord(0.0, 10.0), + Coord(5.0, 5.0), + Coord(0.0, 10.0), - Coord(20.0, 10.0), - Coord(20.0, 5.0), + Coord(20.0, 10.0), + Coord(20.0, 5.0), - Coord(40.0, 100.0), - Coord(35.0, 105.0), + Coord(40.0, 100.0), + Coord(35.0, 105.0), - Coord(5.0, 105.0), - Coord(0.0, 110.0), - }, - {Edge(0, 1), Edge(2, 3), Edge(4, 5), Edge(6, 7), Edge(8, 9)}); + Coord(5.0, 105.0), + Coord(0.0, 110.0), + }, + {Edge(0, 1), Edge(2, 3), Edge(4, 5), Edge(6, 7), Edge(8, 9)}); typedef StaticRTree, false, 2, 3> MiniStaticRTree; std::string leaves_path; std::string nodes_path; - build_rtree( - "test_regression", &fixture, leaves_path, nodes_path); + build_rtree("test_regression", &fixture, leaves_path, + nodes_path); MiniStaticRTree rtree(nodes_path, leaves_path, fixture.coords); // query a node just right of the center of the gap