Some std::vector tests are FAILing for 32-bit targets because
std::vector now rounds up allocations to an alignment boundary,
perturbing the expected capacity of the vectors in the tests.
Tweak the tests so that they don't depend on the precise capacity, which
is unspecified anyway.
The 23_containers/vector/modifiers/insert_vs_emplace.cc test still
FAILs, that needs a different fix.
libstdc++-v3/ChangeLog:
* testsuite/23_containers/vector/modifiers/emplace/self_emplace.cc:
Ensure there is no unused capacity before inserting new element.
* testsuite/23_containers/vector/modifiers/insert/self_insert.cc:
Likewise.
};
// Make sure emplace will imply reallocation.
- VERIFY( vv.capacity() == 3 );
+ const auto n = vv.capacity();
+ vv.resize(n);
vv.emplace(vv.begin(), vv[0]);
- VERIFY( vv.size() == 4 );
+ VERIFY( vv.size() == (n + 1) );
VERIFY( vv[0].size() == 2 );
VERIFY( vv[0][0] == 2 );
VERIFY( vv[0][1] == 3 );
};
// Make sure we will reallocate for insertion.
- VERIFY( vv.capacity() == 3 );
+ const auto n = vv.capacity();
+ vv.resize(n);
vv.insert(vv.begin(), vv[0]);
- VERIFY( vv.size() == 4 );
+ VERIFY( vv.size() == (n + 1) );
VERIFY( vv[0].size() == 2 );
VERIFY( vv[0][0] == 2 );
VERIFY( vv[0][1] == 3 );