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

srtm_parser_test.cpp « generator_tests « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fa8b7acc0642627768f17327b69ddaaa5674877e (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
#include "testing/testing.hpp"

#include "generator/srtm_parser.hpp"

using namespace generator;

namespace
{
inline std::string GetBase(ms::LatLon const & coord) { return SrtmTile::GetBase(coord); }

UNIT_TEST(FilenameTests)
{
  auto name = GetBase({56.4566, 37.3467});
  TEST_EQUAL(name, "N56E037", ());

  name = GetBase({34.077433, -118.304569});
  TEST_EQUAL(name, "N34W119", ());

  name = GetBase({0.1, 0.1});
  TEST_EQUAL(name, "N00E000", ());

  name = GetBase({-35.35, -12.1});
  TEST_EQUAL(name, "S36W013", ());

  name = GetBase({-34.622358, -58.383654});
  TEST_EQUAL(name, "S35W059", ());
}
}  // namespace