Update tests expectations and obvious detection

This commit is contained in:
Michael Krasnyk
2018-02-13 16:08:53 +01:00
parent d166fc6a75
commit 8b52c6c7ac
13 changed files with 328 additions and 930 deletions
+9 -8
View File
@@ -154,16 +154,17 @@ inline std::uint32_t getRoadGroup(const RoadClassification classification)
return upper - dividers;
}
// a road classification is strictly less, if it belongs to a lower general category of roads. E.g.
// normal city roads are strictly less of a priority than a motorway and alleys are strictly less
// than inner-city roads
// LHS road classification is strictly less than RHS, if it belongs to a lower general category
// of roads. E.g. normal city roads are strictly less of a priority than a motorway and alleys
// are strictly less than inner-city roads.
inline bool strictlyLess(const RoadClassification lhs, const RoadClassification rhs)
{
const auto lhs_class = getRoadGroup(lhs);
const auto rhs_class = getRoadGroup(rhs);
// different class, not neighbors
return lhs_class > rhs_class &&
((lhs.GetPriority() - rhs.GetPriority() > 4) || lhs.IsLowPriorityRoadClass());
if (!lhs.IsLowPriorityRoadClass() && rhs.IsLowPriorityRoadClass())
return false;
if (lhs.IsLowPriorityRoadClass() && !rhs.IsLowPriorityRoadClass())
return true;
return getRoadGroup(lhs) > getRoadGroup(rhs);
}
// check whether a link class is the fitting link class to a road