Fixes bearing range of zero exhaustive graph traversal
This commit is contained in:
parent
c306a59854
commit
a289e1cd96
@ -20,6 +20,7 @@
|
|||||||
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
|
- Fixed an issue that could emit `invalid` as instruction when ending on a sliproad after a traffic-light
|
||||||
- Fixed an issue that would detect turning circles as sliproads
|
- Fixed an issue that would detect turning circles as sliproads
|
||||||
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
|
- Fixed a bug where post-processing instructions (e.g. left + left -> uturn) could result in false pronunciations
|
||||||
|
- Fixes a bug where a bearing range of zero would cause exhaustive graph traversals
|
||||||
|
|
||||||
# 5.3.0
|
# 5.3.0
|
||||||
Changes from 5.3.0-rc.3
|
Changes from 5.3.0-rc.3
|
||||||
|
@ -67,7 +67,7 @@ inline bool CheckInBounds(const int A, const int B, const int range)
|
|||||||
|
|
||||||
if (range >= 180)
|
if (range >= 180)
|
||||||
return true;
|
return true;
|
||||||
if (range <= 0)
|
if (range < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Map both bearings into positive modulo 360 space
|
// Map both bearings into positive modulo 360 space
|
||||||
|
@ -42,6 +42,9 @@ BOOST_AUTO_TEST_CASE(bearing_range_test)
|
|||||||
|
|
||||||
BOOST_CHECK_EQUAL(true, bearing::CheckInBounds(-721, 5, 10));
|
BOOST_CHECK_EQUAL(true, bearing::CheckInBounds(-721, 5, 10));
|
||||||
BOOST_CHECK_EQUAL(true, bearing::CheckInBounds(719, 5, 10));
|
BOOST_CHECK_EQUAL(true, bearing::CheckInBounds(719, 5, 10));
|
||||||
|
|
||||||
|
BOOST_CHECK_EQUAL(false, bearing::CheckInBounds(1, 1, -1));
|
||||||
|
BOOST_CHECK_EQUAL(true, bearing::CheckInBounds(1, 1, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user