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

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

#include "storage/storage_tests/helpers.hpp"

#include "storage/country_info_getter.hpp"

#include "platform/platform.hpp"

namespace storage
{
unique_ptr<CountryInfoGetter> CreateCountryInfoGetter()
{
  return CountryInfoReader::CreateCountryInfoReaderTwoComponentMwms(GetPlatform());
}

unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetterMigrate()
{
  return CountryInfoReader::CreateCountryInfoReaderOneComponentMwms(GetPlatform());
}

bool AlmostEqualRectsAbs(const m2::RectD & r1, const m2::RectD & r2)
{
  double constexpr kEpsilon = 1e-3;
  return my::AlmostEqualAbs(r1.maxX(), r2.maxX(), kEpsilon)
      && my::AlmostEqualAbs(r1.maxY(), r2.maxY(), kEpsilon)
      && my::AlmostEqualAbs(r1.minX(), r2.minX(), kEpsilon)
      && my::AlmostEqualAbs(r1.minY(), r2.minY(), kEpsilon);
}
}  // namespace storage