Skip to content

Commit

Permalink
fix: lanelet2_routing tests on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 21, 2023
1 parent 67c1e2b commit a199a90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lanelet2_routing/test/test_routing_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,13 @@ class RoutingGraphTestData {
}
};

namespace { // NOLINT
static RoutingGraphTestData testData; // NOLINT
} // namespace
// namespace data { // NOLINT
// static RoutingGraphTestData testData; // NOLINT
// } // namespace data

class RoutingGraphTest : public ::testing::Test {
public:
inline static RoutingGraphTestData testData;

Check warning on line 486 in lanelet2_routing/test/test_routing_map.h

View workflow job for this annotation

GitHub Actions / lint

/lanelet2_routing/test/test_routing_map.h:486:38 [cppcoreguidelines-avoid-non-const-global-variables]

variable 'testData' is non-const and globally accessible, consider making it const
const std::unordered_map<Id, Lanelet>& lanelets{testData.lanelets};
const std::unordered_map<Id, Area>& areas{testData.areas};
const std::unordered_map<Id, Point3d>& points{testData.points};
Expand Down

0 comments on commit a199a90

Please sign in to comment.