Skip to content

Commit 720f8f3

Browse files
committed
Merges test datasets: keeps Berlin, removes Monaco
1 parent f4fdcca commit 720f8f3

24 files changed

+146
-346
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Thumbs.db
4646
#######################
4747
/build/
4848
/example/build/
49-
/test/data/monaco*
49+
/test/data/berlin*
5050
/test/bindings/node/data/berlin*
5151
/cmake/postinst
5252

@@ -87,7 +87,7 @@ stxxl.errlog
8787
/test/cache
8888
/test/speeds.csv
8989
/test/penalties.csv
90-
/test/data/monaco.*
90+
/test/data/berlin.*
9191
node_modules
9292

9393
# Deprecated config file #

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ install:
196196
script:
197197
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
198198
- make -C test/data benchmark
199-
- ./example/build/osrm-example test/data/monaco_CH.osrm
199+
- ./example/build/osrm-example test/data/berlin_CH.osrm
200200
# All tests assume to be run from the build directory
201201
- pushd ${OSRM_BUILD_DIR}
202202
- ./unit_tests/library-tests

appveyor-build.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ unit_tests\%Configuration%\server-tests.exe
133133
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
134134

135135
ECHO running library-tests.exe ...
136-
SET test_region=monaco
136+
SET test_region=berlin
137137
SET test_osm=%test_region%.osm.pbf
138138
SET test_osm_ch=%test_region%_CH.osm.pbf
139139
SET test_osm_corech=%test_region%_CoreCH.osm.pbf
140140
SET test_osm_mld=%test_region%_MLD.osm.pbf
141-
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
141+
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/berlin.osm.pbf -OutFile %test_osm%
142142
COPY %test_osm% %test_osm_ch%
143143
COPY %test_osm% %test_osm_corech%
144144
COPY %test_osm% %test_osm_mld%

docs/testing.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ You should see the compiled binaries in `build/unit_tests`, you can then run eac
4646
./engine-tests
4747
```
4848

49-
For `library-tests` you will need to provide a path to the test data:
50-
51-
```
52-
./library-tests ../../test/data/monaco.osrm
53-
```
54-
5549
## Cucumber
5650

5751
For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite).

example/example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ int main(int argc, const char *argv[])
3939
// The following shows how to use the Route service; configure this service
4040
RouteParameters params;
4141

42-
// Route in monaco
43-
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}});
44-
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}});
42+
// Route in Berlin: Alexanderplatz to Hackescher Markt
43+
params.coordinates.push_back({util::FloatLongitude{13.414307}, util::FloatLatitude{52.521835}});
44+
params.coordinates.push_back({util::FloatLongitude{13.402290}, util::FloatLatitude{52.523728}});
4545

4646
// Response is in JSON format
4747
json::Object result;
@@ -59,7 +59,7 @@ int main(int argc, const char *argv[])
5959
const auto duration = route.values["duration"].get<json::Number>().value;
6060

6161
// Warn users if extract does not contain the default Berlin coordinates from above
62-
if (distance == 0 or duration == 0)
62+
if (distance == 0 || duration == 0)
6363
{
6464
std::cout << "Note: distance or duration is zero. ";
6565
std::cout << "You are probably doing a query outside of the OSM extract.\n\n";

example/example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ var OSRM = require('..');
55
var path = require('path');
66

77
var app = express();
8-
var osrm = new OSRM(path.join(__dirname,"../test/data/monaco.osrm"));
8+
var osrm = new OSRM(path.join(__dirname,"../test/data/berlin_CH.osrm"));
99

1010
// Accepts a query like:
11-
// http://localhost:8888?start=13.438640,52.519930&end=13.415852,52.513191
11+
// http://localhost:8888?start=13.414307,52.521835&end=13.402290,52.523728
1212
app.get('/', function(req, res) {
1313
if (!req.query.start || !req.query.end) {
1414
return res.json({"error":"invalid start and end query"});

scripts/poly2req.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ else if (process.argv.length > 2 && process.argv[2] == "dc")
5151
}
5252
else if (process.argv.length > 2)
5353
{
54-
let monaco_poly_path = process.argv[2];
55-
let poly_data = fs.readFileSync(monaco_poly_path, 'utf-8');
54+
let poly_path = process.argv[2];
55+
let poly_data = fs.readFileSync(poly_path, 'utf-8');
5656

5757
// lets assume there is only one ring
5858
// cut of name and ring number and the two END statements

src/benchmarks/match.cpp

Lines changed: 61 additions & 108 deletions
Large diffs are not rendered by default.

test/data/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DATA_NAME:=monaco
1+
DATA_NAME:=berlin
22
DATA_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).osm.pbf
33
DATA_POLY_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).poly
44
OSRM_BUILD_DIR?=../../build

test/data/data.md5sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2b8dd9343d5e615afc9c67bcc7028a63 monaco.osm.pbf
2-
b0788991ab3791d53c1c20b6281f81ad monaco.poly
1+
54707104e9f411d1a3032c00fb1276c6 berlin.osm.pbf
2+
031d988f23fc2a30371c9ef8d2a49bae berlin.poly

test/nodejs/data/Makefile

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/nodejs/data/data.md5sum

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/nodejs/data/md5sum.js

Lines changed: 0 additions & 92 deletions
This file was deleted.

test/nodejs/osrm-data-path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var path = require('path');
22

33
if (process.env.OSRM_DATA_PATH !== undefined) {
4-
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH),"berlin-latest.osrm");
4+
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "berlin_CH.osrm");
55
console.log('Setting custom data path to ' + exports.data_path);
66
} else {
7-
exports.data_path = path.resolve(path.join(__dirname,"data/berlin-latest.osrm"));
7+
exports.data_path = path.resolve(path.join(__dirname, "../data/berlin_CH.osrm"));
88
}

unit_tests/library/coordinates.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <vector>
77

8-
// Somewhere in 2b8dd9343d5e615afc9c67bcc7028a63 Monaco
8+
// Somewhere in d41d8cd98f00b204e9800998ecf8427e Berlin
99

1010
// Convenience aliases
1111
using Longitude = osrm::util::FloatLongitude;
@@ -15,21 +15,21 @@ using Locations = std::vector<Location>;
1515

1616
inline Location get_dummy_location()
1717
{
18-
return {osrm::util::FloatLongitude{7.437069}, osrm::util::FloatLatitude{43.749249}};
18+
return {osrm::util::FloatLongitude{13.388860}, osrm::util::FloatLatitude{52.517037}};
1919
}
2020

2121
inline Locations get_locations_in_small_component()
2222
{
23-
return {{Longitude{7.438023}, Latitude{43.746465}},
24-
{Longitude{7.439263}, Latitude{43.746543}},
25-
{Longitude{7.438190}, Latitude{43.747560}}};
23+
return {{Longitude{13.459765}, Latitude{52.543193}},
24+
{Longitude{13.461455}, Latitude{52.542381}},
25+
{Longitude{13.462940}, Latitude{52.541774}}};
2626
}
2727

2828
inline Locations get_locations_in_big_component()
2929
{
30-
return {{Longitude{7.415800}, Latitude{43.734132}},
31-
{Longitude{7.417710}, Latitude{43.736721}},
32-
{Longitude{7.421315}, Latitude{43.738814}}};
30+
return {{Longitude{13.442631}, Latitude{52.551110}},
31+
{Longitude{13.441193}, Latitude{52.549506}},
32+
{Longitude{13.439648}, Latitude{52.547705}}};
3333
}
3434

3535
#endif

unit_tests/library/extract.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
1919
BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
2020
{
2121
osrm::ExtractorConfig config;
22-
config.input_path = {OSRM_TEST_DATA_DIR "/monaco.osm.pbf"};
22+
config.input_path = OSRM_TEST_DATA_DIR "/berlin.osm.pbf";
2323
config.requested_num_threads = tbb::task_scheduler_init::default_num_threads();
2424
BOOST_CHECK_NO_THROW(osrm::extract(config));
2525
}

unit_tests/library/limits.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
2828
using namespace osrm;
2929

3030
EngineConfig config;
31-
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
31+
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
3232
config.use_shared_memory = false;
3333
config.max_locations_trip = 2;
3434

@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
5555
using namespace osrm;
5656

5757
EngineConfig config;
58-
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
58+
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
5959
config.use_shared_memory = false;
6060
config.max_locations_viaroute = 2;
6161

@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
8282
using namespace osrm;
8383

8484
EngineConfig config;
85-
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
85+
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
8686
config.use_shared_memory = false;
8787
config.max_locations_distance_table = 2;
8888

@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
109109
using namespace osrm;
110110

111111
EngineConfig config;
112-
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
112+
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
113113
config.use_shared_memory = false;
114114
config.max_locations_map_matching = 2;
115115

@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_limits)
136136
using namespace osrm;
137137

138138
EngineConfig config;
139-
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
139+
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
140140
config.use_shared_memory = false;
141141
config.max_results_nearest = 2;
142142

unit_tests/library/match.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_match)
1919
{
2020
using namespace osrm;
2121

22-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
22+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
2323

2424
MatchParameters params;
2525
params.coordinates.push_back(get_dummy_location());

unit_tests/library/nearest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BOOST_AUTO_TEST_SUITE(nearest)
1616

1717
BOOST_AUTO_TEST_CASE(test_nearest_response)
1818
{
19-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
19+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
2020

2121
using namespace osrm;
2222

@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)
4343

4444
BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
4545
{
46-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
46+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
4747

4848
using namespace osrm;
4949

@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
5959

6060
BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
6161
{
62-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
62+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
6363

6464
using namespace osrm;
6565

@@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
7777

7878
BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
7979
{
80-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
80+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
8181

8282
using namespace osrm;
8383

0 commit comments

Comments
 (0)