Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple warning fix on test gurka #4637

Merged
merged 7 commits into from Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem to be used at all so we can remove it?

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