Add additional tests in an attempt to diagnose ARM test failures.
Currently 4 tests are failing on the ARM buildbot. To try and diagnose each
of the failures this patch does the following:
1) path.itr/iterator.pass.cpp
* Temporarily print iteration sequence to see where its failing.
2) path.native.obs/string_alloc.pass.cpp
* Remove test that ::new is not called when constructing a short string
that requires a conversion. Since during the conversion global locale
objects might be constructed.
3) fs.op.funcs/space.pass.cpp
* Explicitly use uintmax_t in the implementation of space, hopefully
preventing possible overflows.
* Add additional tests that check for overflow is the calculation of the
space_info values.
* Add additional tests for the values returned from statfvs.
4) fs.op.funcs/last_write_time.pass.cpp
* No changes made yet.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -669,7 +669,7 @@ void __resize_file(const path& p, std::uintmax_t size, std::error_code *ec) {
|
||||
|
||||
space_info __space(const path& p, std::error_code *ec) {
|
||||
space_info si;
|
||||
struct statvfs m_svfs;
|
||||
struct statvfs m_svfs = {};
|
||||
if (::statvfs(p.c_str(), &m_svfs) == -1) {
|
||||
set_or_throw(ec, "space", p);
|
||||
si.capacity = si.free = si.available =
|
||||
@@ -678,7 +678,7 @@ space_info __space(const path& p, std::error_code *ec) {
|
||||
}
|
||||
if (ec) ec->clear();
|
||||
// Multiply with overflow checking.
|
||||
auto do_mult = [&](std::uintmax_t& out, fsblkcnt_t other) {
|
||||
auto do_mult = [&](std::uintmax_t& out, std::uintmax_t other) {
|
||||
out = other * m_svfs.f_frsize;
|
||||
if (out / other != m_svfs.f_frsize || other == 0)
|
||||
out = static_cast<std::uintmax_t>(-1);
|
||||
|
||||
Reference in New Issue
Block a user