forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
549cd65ad5
commit
66ed08f07c
4 changed files with 18 additions and 7 deletions
|
@ -65,7 +65,7 @@ UNIT_CLASS_TEST(CentersTableTest, Smoke)
|
|||
|
||||
m2::PointD expected = feature::GetCenter(ft);
|
||||
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, expected), 1, (id));
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, expected), 1.0, (id));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ UNIT_CLASS_TEST(CentersTableTest, SmokeV0)
|
|||
|
||||
m2::PointD expected = feature::GetCenter(ft);
|
||||
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, expected), 1, (id));
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, expected), 1.0, (id));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ UNIT_CLASS_TEST(CentersTableTest, Subset)
|
|||
if (j != features.size() && i == features[j].first)
|
||||
{
|
||||
TEST(table->Get(i, actual), ());
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, features[j].second), 1, ());
|
||||
TEST_LESS_OR_EQUAL(MercatorBounds::DistanceOnEarth(actual, features[j].second), 1.0, ());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -79,4 +79,14 @@ std::string DebugPrint(MwmTraits::HouseToStreetTableFormat format)
|
|||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::string DebugPrint(MwmTraits::CentersTableFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case MwmTraits::CentersTableFormat::PlainEliasFanoMap: return "PlainEliasFanoMap";
|
||||
case MwmTraits::CentersTableFormat::EliasFanoMapWithHeader: return "EliasFanoMapWithHeader";
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
} // namespace version
|
||||
|
|
|
@ -43,10 +43,10 @@ public:
|
|||
|
||||
enum class CentersTableFormat
|
||||
{
|
||||
// Centers table encoded without any header. Coding params from mwm header used.
|
||||
// Centers table encoded without any header. Coding params from mwm header are used.
|
||||
PlainEliasFanoMap,
|
||||
|
||||
// Centers table has it's own header with version and coding params.
|
||||
// Centers table has its own header with version and coding params.
|
||||
EliasFanoMapWithHeader,
|
||||
};
|
||||
|
||||
|
@ -77,4 +77,5 @@ private:
|
|||
|
||||
std::string DebugPrint(MwmTraits::SearchIndexFormat format);
|
||||
std::string DebugPrint(MwmTraits::HouseToStreetTableFormat format);
|
||||
std::string DebugPrint(MwmTraits::CentersTableFormat format);
|
||||
} // namespace version
|
||||
|
|
|
@ -44,8 +44,8 @@ PostcodePoints::PostcodePoints(MwmValue const & value)
|
|||
|
||||
version::MwmTraits traits(value.GetMwmVersion());
|
||||
auto const format = traits.GetCentersTableFormat();
|
||||
CHECK(format == version::MwmTraits::CentersTableFormat::EliasFanoMapWithHeader,
|
||||
("Unexpected format."));
|
||||
CHECK_EQUAL(format, version::MwmTraits::CentersTableFormat::EliasFanoMapWithHeader,
|
||||
("Unexpected format."));
|
||||
|
||||
m_pointsSubReader =
|
||||
reader.GetPtr()->CreateSubReader(m_header.m_pointsOffset, m_header.m_pointsSize);
|
||||
|
|
Loading…
Add table
Reference in a new issue