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: 87e17e182878441f0500e8cf4110597d93edeea3 (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 "storage/storage_tests/helpers.hpp"

#include "storage/country_info_getter.hpp"

#include "platform/platform.hpp"

#include <memory>

namespace storage
{
std::unique_ptr<CountryInfoGetter> CreateCountryInfoGetterObsolete()
{
  return CountryInfoReader::CreateCountryInfoReaderObsolete(GetPlatform());
}

std::unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter()
{
  return CountryInfoReader::CreateCountryInfoReader(GetPlatform());
}

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