Incorrect error message when unable to snap all input coordinates (#5846)

In cases where we are unable to find a phantom node for an input
coordinate, we return an error indicating which coordinate failed.

This would always refer to the coordinate with index equal to the
number of valid phantom nodes found.

We fix this by instead returning the first index for which a
phantom node could not be found.
This commit is contained in:
Michael Bell
2020-10-01 02:44:22 +01:00
committed by GitHub
parent f6b313e958
commit 4799b46eeb
6 changed files with 23 additions and 8 deletions
+2
View File
@@ -242,6 +242,8 @@ BOOST_AUTO_TEST_CASE(test_table_no_segment_for_some_coordinates)
BOOST_CHECK(rc == Status::Error);
const auto code = json_result.values.at("code").get<json::String>().value;
BOOST_CHECK_EQUAL(code, "NoSegment");
const auto message = json_result.values.at("message").get<json::String>().value;
BOOST_CHECK_EQUAL(message, "Could not find a matching segment for coordinate 0");
}
BOOST_AUTO_TEST_CASE(test_table_serialiaze_fb)