[core] Move ProjectedMeters to projection.hpp
This commit is contained in:
committed by
Bruno de Oliveira Abinader
parent
092da9c956
commit
ddecdeca94
@@ -1,7 +1,6 @@
|
||||
#include <mbgl/test/util.hpp>
|
||||
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/util/geo.hpp>
|
||||
#include <mbgl/util/projection.hpp>
|
||||
|
||||
#include <limits>
|
||||
@@ -61,3 +60,18 @@ TEST(Projection, ProjectedMeters) {
|
||||
EXPECT_EQ(latLng.latitude(), util::LATITUDE_MAX);
|
||||
EXPECT_EQ(latLng.longitude(), util::LONGITUDE_MAX);
|
||||
}
|
||||
|
||||
TEST(Projection, InvalidProjectedMeters) {
|
||||
try {
|
||||
ProjectedMeters { NAN };
|
||||
ASSERT_TRUE(false) << "should throw";
|
||||
} catch (const std::domain_error& error) {
|
||||
ASSERT_EQ(std::string(error.what()), "northing must not be NaN");
|
||||
}
|
||||
try {
|
||||
ProjectedMeters { 0, NAN };
|
||||
ASSERT_TRUE(false) << "should throw";
|
||||
} catch (const std::domain_error& error) {
|
||||
ASSERT_EQ(std::string(error.what()), "easting must not be NaN");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user