Welcome to mirror list, hosted at ThFree Co, Russian Federation.

geourl_test.cpp « map_tests « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d715e4cc1687a55972c7ffaacc356c6f0d7c9043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "../../testing/testing.hpp"

#include "../geourl_process.hpp"

using namespace url_scheme;

UNIT_TEST(ProcessURL_Smoke)
{
  Info info;
  ParseURL("geo:53.666,27.666", info);
  TEST(info.IsValid(), ());
  TEST_ALMOST_EQUAL(info.m_lat, 53.666, ());
  TEST_ALMOST_EQUAL(info.m_lon, 27.666, ());

  info.Reset();
  ParseURL("mapswithme:53.666,27.666", info);
  TEST(info.IsValid(), ());
  TEST_ALMOST_EQUAL(info.m_lat, 53.666, ());
  TEST_ALMOST_EQUAL(info.m_lon, 27.666, ());

  info.Reset();
  ParseURL("mapswithme://point/?lon=27.666&lat=53.666&zoom=10", info);
  TEST(info.IsValid(), ());
  TEST_ALMOST_EQUAL(info.m_lat, 53.666, ());
  TEST_ALMOST_EQUAL(info.m_lon, 27.666, ());
  TEST_ALMOST_EQUAL(info.m_zoom, 10.0, ());

  info.Reset();
  ParseURL("geo:53.666", info);
  TEST(!info.IsValid(), ());
}