Merge pull request #10365 from Icinga/string-vector-move-test

Avoid undefined behavior in string/vector_move test
This commit is contained in:
Julian Brost 2025-03-10 14:51:20 +01:00 committed by GitHub
commit cefe1bc27a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE(vector_move)
void *oldAddr = vec[0].GetData().data();
// Sanity check that the data buffer is actually allocated outside the icinga::String instance.
BOOST_CHECK(!(&vec[0] <= oldAddr && oldAddr < &vec[1]));
BOOST_CHECK(!(vec.data() <= oldAddr && oldAddr < vec.data() + vec.size()));
// Force the vector to grow.
vec.reserve(vec.capacity() + 1);