diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-04-12 16:39:25 -0700 |
---|---|---|
committer | Lauren Budorick <lauren@mapbox.com> | 2017-04-24 17:10:31 -0700 |
commit | f1e191ba4be76d6c8e8cf6f7c34235bdbc4c377f (patch) | |
tree | daedf47da032da960bcb8823b0f0b03ecf4753ed | |
parent | 52b4120918a57eec3c85c5b0a2c31909b6b3f8cf (diff) | |
download | qtlocation-mapboxgl-f1e191ba4be76d6c8e8cf6f7c34235bdbc4c377f.tar.gz |
Per review:
* Turn unnecessary lambda fns into regular fns in position.test.cpp
-rw-r--r-- | test/util/position.test.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/util/position.test.cpp b/test/util/position.test.cpp index 7b2d5397d4..938a08dded 100644 --- a/test/util/position.test.cpp +++ b/test/util/position.test.cpp @@ -7,13 +7,13 @@ using namespace mbgl; using namespace style; -auto ARR_EQ = [](std::array<float, 3> got, std::array<float, 3> expected) { +void expectArrayEQ(std::array<float, 3> got, std::array<float, 3> expected) { for (int i = 0; i < 3; i++) { EXPECT_NEAR(got[i], expected[i], 0.00001); } }; -auto ARR_NE = [](std::array<float, 3> got, std::array<float, 3> expected) { +void expectArrayNE(std::array<float, 3> got, std::array<float, 3> expected) { short eq = 0; for (int i = 0; i < 3; i++) { if (got[i] == expected[i]) { @@ -32,18 +32,18 @@ TEST(Position, Calculations) { Position position(spherical); - ARR_NE(position.getCartesian(), spherical); - ARR_EQ(position.getSpherical(), spherical); + expectArrayNE(position.getCartesian(), spherical); + expectArrayEQ(position.getSpherical(), spherical); - ARR_EQ(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }}); + expectArrayEQ(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }}); - ARR_NE(createPosition({{ 2, 30, 10 }}).getSpherical(), createPosition({{ 2, 30, 370 }}).getSpherical()); - ARR_EQ(createPosition({{ 2, 30, 10 }}).getCartesian(), createPosition({{ 2, 30, 370 }}).getCartesian()); + expectArrayNE(createPosition({{ 2, 30, 10 }}).getSpherical(), createPosition({{ 2, 30, 370 }}).getSpherical()); + expectArrayEQ(createPosition({{ 2, 30, 10 }}).getCartesian(), createPosition({{ 2, 30, 370 }}).getCartesian()); std::array<float, 3> newSpherical = {{ 1, 80, 270 }}; position.set(newSpherical); - ARR_NE(position.getSpherical(), spherical); - ARR_NE(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }}); - ARR_EQ(position.getCartesian(), {{ 0.98480772972106934, -0.17364829778671265, 1.1924880638503055e-08 }}); + expectArrayNE(position.getSpherical(), spherical); + expectArrayNE(position.getCartesian(), {{ 0.34729638695716858, -1.9696154594421387, 2.384976127700611e-08 }}); + expectArrayEQ(position.getCartesian(), {{ 0.98480772972106934, -0.17364829778671265, 1.1924880638503055e-08 }}); } |