Repository navigation
tests: fix std::min type mismatch in geometry_test (macOS arm64) - #56
Merged
Merged
Conversation
geometry_test.cpp:1030 called std::min(source.num_points(), size_t(100)) where num_points() returns uint64_t. On macOS arm64 size_t is unsigned long and uint64_t is unsigned long long; even though they are the same width, template deduction fails. Linux x86_64 happens to typedef both as unsigned long so this only broke on macOS. The bug was latent until #55 turned on CVC_BUILD_TESTS=ON in the macOS package-* jobs. Use an explicit template argument so the literal 100 just deduces to size_t.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
std::min(source.num_points(), size_t(100))fails to deduce_Tpon macOS arm64 wheresize_tisunsigned longbutnum_points()returnsuint64_t(=unsigned long long). Linux x86_64 happens to typedef both asunsigned longso this only broke on macOS.Was latent until #55 turned on
CVC_BUILD_TESTS=ONin the macOSpackage-*jobs. Fix is a one-line explicit template arg.