Skip to content

Commit 0567c96

Browse files
committed
Use using to make tests more readable
1 parent 1e3dfe5 commit 0567c96

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/test-geom.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212
#include "geom.hpp"
1313

14+
using Coordinates = osmium::geom::Coordinates;
15+
1416
TEST_CASE("geom::distance", "[NoDB]")
1517
{
16-
osmium::geom::Coordinates const p1{10, 10};
17-
osmium::geom::Coordinates const p2{20, 10};
18-
osmium::geom::Coordinates const p3{13, 14};
18+
Coordinates const p1{10, 10};
19+
Coordinates const p2{20, 10};
20+
Coordinates const p3{13, 14};
1921

2022
REQUIRE(geom::distance(p1, p1) == Approx(0.0));
2123
REQUIRE(geom::distance(p1, p2) == Approx(10.0));
@@ -24,8 +26,8 @@ TEST_CASE("geom::distance", "[NoDB]")
2426

2527
TEST_CASE("geom::interpolate", "[NoDB]")
2628
{
27-
osmium::geom::Coordinates const p1{10, 10};
28-
osmium::geom::Coordinates const p2{20, 10};
29+
Coordinates const p1{10, 10};
30+
Coordinates const p2{20, 10};
2931

3032
auto const i1 = geom::interpolate(p1, p1, 0.5);
3133
REQUIRE(i1.x == 10);
@@ -45,8 +47,8 @@ TEST_CASE("geom::linestring_t", "[NoDB]")
4547
geom::linestring_t ls1;
4648

4749
REQUIRE(ls1.empty());
48-
ls1.add_point(osmium::geom::Coordinates{17, 42});
49-
ls1.add_point(osmium::geom::Coordinates{-3, 22});
50+
ls1.add_point(Coordinates{17, 42});
51+
ls1.add_point(Coordinates{-3, 22});
5052
REQUIRE(!ls1.empty());
5153
REQUIRE(ls1.size() == 2);
5254

0 commit comments

Comments
 (0)