MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/map/map_tests/mwm_url_tests.cpp:24–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22double const kEps = 1e-10;
23
24UNIT_TEST(MapApiSmoke)
25{
26 string urlString =
27 "mapswithme://"
28 "map?ll=38.970559,-9.419289&ignoreThisParam=Yes&z=17&n=Point%20Name&s=black&backurl=https%3A%2F%2Fcomaps.app";
29 TEST(url::Url(urlString).IsValid(), ());
30
31 ParsedMapApi test(urlString);
32 TEST_EQUAL(test.GetRequestType(), UrlType::Map, ());
33 TEST_EQUAL(test.GetMapPoints().size(), 1, ());
34 MapPoint const & p0 = test.GetMapPoints()[0];
35 TEST_ALMOST_EQUAL_ABS(p0.m_lat, 38.970559, kEps, ());
36 TEST_ALMOST_EQUAL_ABS(p0.m_lon, -9.419289, kEps, ());
37 TEST_EQUAL(p0.m_name, "Point Name", ());
38 TEST_EQUAL(p0.m_id, "", ());
39 TEST_EQUAL(p0.m_style, "black", ());
40 TEST_ALMOST_EQUAL_ABS(test.GetZoomLevel(), 17.0, kEps, ());
41 TEST_EQUAL(test.GetGlobalBackUrl(), "https://comaps.app", ());
42}
43
44UNIT_TEST(RouteApiSmoke)
45{

Callers 1

mwm_url_tests.cppFile · 0.70

Calls 12

TESTFunction · 0.85
generateRandomTestFunction · 0.85
GetRequestTypeMethod · 0.80
GetCenterLatLonMethod · 0.80
SetUrlAndParseMethod · 0.80
UrlClass · 0.50
FromLatLonFunction · 0.50
IsValidMethod · 0.45
sizeMethod · 0.45
GetZoomLevelMethod · 0.45
GetRoutePointsMethod · 0.45
GetApiVersionMethod · 0.45

Tested by

no test coverage detected