Commit fb03d022 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Capturing all of the failure cases in CoordinateConversion::validate().

parent 3f44cc35
Pipeline #12882 passed with stages
in 9 minutes and 45 seconds
......@@ -22,6 +22,46 @@ TEST(Radixgeo, CoordinateRange)
"[-180,180).",
error_message);
}
try
{
CoordinateConversion::validate(91, -179);
}
catch (std::out_of_range e)
{
std::string error_message(e.what());
EXPECT_EQ(
"Invalid coordinate [91,-179].\nLatitude must be [-90.,90.] and "
"longitude must be "
"[-180,180).",
error_message);
}
try
{
CoordinateConversion::validate(-80, -190);
}
catch (std::out_of_range e)
{
std::string error_message(e.what());
EXPECT_EQ(
"Invalid coordinate [-80,-190].\nLatitude must be [-90.,90.] and "
"longitude must be "
"[-180,180).",
error_message);
}
try
{
CoordinateConversion::validate(-80, 190);
}
catch (std::out_of_range e)
{
std::string error_message(e.what());
EXPECT_EQ(
"Invalid coordinate [-80,190].\nLatitude must be [-90.,90.] and "
"longitude must be "
"[-180,180).",
error_message);
}
}
TEST(Radixgeo, CoordinateConversion) {}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment