Skip to content

Commit

Permalink
use qi - parser to work with 0 speed file lines
Browse files Browse the repository at this point in the history
  • Loading branch information
karenzshea authored and Patrick Niklaus committed Feb 13, 2017
1 parent 23b07c9 commit 1bace12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions features/options/contract/datasources.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ Feature: osrm-contract command line options: datasources
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
And it should exit successfully

Scenario: osrm-contract - Passing base file
Given the speed file
"""
"""
And the data has been extracted
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then it should exit successfully
2 changes: 1 addition & 1 deletion src/contractor/contractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ template <typename Key, typename Value> struct CSVFilesParser
qi::rule<Iterator, std::pair<Key, Value>()> csv_line =
(key_rule >> ',' >> value_source) >> -(',' >> *(qi::char_ - qi::eol));
std::vector<std::pair<Key, Value>> result;
const auto ok = qi::parse(first, last, (csv_line % qi::eol) >> *qi::eol, result);
const auto ok = qi::parse(first, last, -(csv_line % qi::eol) >> *qi::eol, result);

if (!ok || first != last)
{
Expand Down

0 comments on commit 1bace12

Please sign in to comment.