Skip to content

Commit

Permalink
Simple warning fix on test gurka (#4637)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Mar 19, 2024
1 parent b6bad37 commit 181eed9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
5 changes: 0 additions & 5 deletions test/gurka/CMakeLists.txt
Expand Up @@ -11,22 +11,17 @@ if(ENABLE_DATA_TOOLS)
# "-Werror" flag
# Avoid adding a filename to this list
set(TESTS_WITH_WARNINGS
test_elevation.cc
test_gtfs.cc
test_instructions_roundabout.cc
test_landmarks.cc
test_languages.cc
test_locate.cc
test_match.cc
test_multi_level_loki.cc
test_osrm_serializer.cc
test_pbf_api.cc
test_phonemes.cc
test_phonemes_w_langs.cc
test_recost.cc
test_time_tracking.cc
test_traffic.cc
test_traffic_smoothing.cc
)

## Add executable targets
Expand Down
2 changes: 1 addition & 1 deletion test/gurka/test_elevation.cc
Expand Up @@ -220,7 +220,7 @@ TEST(Standalone, ElevationCompareToSkadi) {
result.Parse(route_json.c_str());

for (size_t leg_index = 0; leg_index < waypoints.size() - 1; ++leg_index) {
auto s =
[[maybe_unused]] auto s =
rapidjson::get_child_optional(result, ("/trip/legs/" + std::to_string(leg_index) + "/shape")
.c_str());

Expand Down
2 changes: 1 addition & 1 deletion test/gurka/test_landmarks.cc
Expand Up @@ -620,7 +620,7 @@ TEST(LandmarkTest, TestLandmarksInManeuvers) {
"Checking landmarks in maneuver failed: cannot find the maneuver in the expected result!");
}
ASSERT_EQ(result_landmarks.size(), expected->second.size());
for (auto i = 0; i < result_landmarks.size(); ++i) {
for (size_t i = 0; i < result_landmarks.size(); ++i) {
EXPECT_EQ(result_landmarks[i], expected->second[i]);
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/gurka/test_match.cc
Expand Up @@ -262,8 +262,9 @@ uint32_t speed_from_edge(const valhalla::Api& api, bool compare_with_previous_ed
node.cost().elapsed_cost().seconds() - node.cost().transition_cost().seconds()) /
3600.0;
auto new_kmh = static_cast<uint32_t>(km / h + .5);
if (is_valid(kmh) && compare_with_previous_edge)
if (is_valid(kmh) && compare_with_previous_edge) {
EXPECT_EQ(kmh, new_kmh);
}
kmh = new_kmh;
}
return kmh;
Expand Down
2 changes: 0 additions & 2 deletions test/gurka/test_traffic.cc
Expand Up @@ -296,8 +296,6 @@ TEST(Traffic, CutGeoms) {
uint32_t index, baldr::TrafficSpeed* current) -> void {
baldr::GraphId tile_id(tile.header->tile_id);
auto BD = gurka::findEdge(reader, map.nodes, "BD", "D", tile_id);
baldr::TrafficSpeed* existing =
const_cast<valhalla::baldr::TrafficSpeed*>(tile.speeds + index);
current->breakpoint1 = 255;
if (std::get<1>(BD) != nullptr && std::get<0>(BD).id() == index) {
current->overall_encoded_speed = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/gurka/test_traffic_smoothing.cc
Expand Up @@ -558,7 +558,7 @@ class MapMatchWithTraffic : public ::testing::Test {
traffic_speed->breakpoint1 = 255;
});

test::customize_historical_traffic(map.config, [](DirectedEdge& e) {
test::customize_historical_traffic(map.config, [](DirectedEdge&) {
// speeds for every 5 min bucket of the week
std::array<float, kBucketsPerWeek> historical;
historical.fill(6);
Expand Down

0 comments on commit 181eed9

Please sign in to comment.