mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-25 04:56:13 +08:00
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:
@@ -27,7 +27,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
#include "assert_checkpoint.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
@@ -43,14 +42,37 @@ void doShortStringTest(MultiStringType const& MS) {
|
||||
Ptr value = MS;
|
||||
const path p((const char*)MS);
|
||||
{
|
||||
DisableAllocationGuard g; // should not allocate
|
||||
CHECKPOINT("short string default constructed allocator");
|
||||
DisableAllocationGuard g;
|
||||
if (!std::is_same<CharT, char>::value)
|
||||
g.release();
|
||||
Str s = p.string<CharT>();
|
||||
assert(s == value);
|
||||
CHECKPOINT("short string provided allocator");
|
||||
Str s2 = p.string<CharT>(Alloc{});
|
||||
assert(s2 == value);
|
||||
}
|
||||
using MAlloc = malloc_allocator<CharT>;
|
||||
MAlloc::reset();
|
||||
{
|
||||
using Traits = std::char_traits<CharT>;
|
||||
using AStr = std::basic_string<CharT, Traits, MAlloc>;
|
||||
AStr s = p.string<CharT, Traits, MAlloc>();
|
||||
assert(s == value);
|
||||
assert(MAlloc::alloc_count == 0);
|
||||
assert(MAlloc::outstanding_alloc() == 0);
|
||||
}
|
||||
MAlloc::reset();
|
||||
{ // Other allocator - provided copy
|
||||
using Traits = std::char_traits<CharT>;
|
||||
using AStr = std::basic_string<CharT, Traits, MAlloc>;
|
||||
MAlloc a;
|
||||
// don't allow another allocator to be default constructed.
|
||||
MAlloc::disable_default_constructor = true;
|
||||
AStr s = p.string<CharT, Traits, MAlloc>(a);
|
||||
assert(s == value);
|
||||
assert(MAlloc::alloc_count == 0);
|
||||
assert(MAlloc::outstanding_alloc() == 0);
|
||||
}
|
||||
MAlloc::reset();
|
||||
}
|
||||
|
||||
template <class CharT>
|
||||
@@ -62,7 +84,6 @@ void doLongStringTest(MultiStringType const& MS) {
|
||||
const path p((const char*)MS);
|
||||
{ // Default allocator
|
||||
using Alloc = std::allocator<CharT>;
|
||||
RequireAllocationGuard g;
|
||||
Str s = p.string<CharT>();
|
||||
assert(s == value);
|
||||
Str s2 = p.string<CharT>(Alloc{});
|
||||
@@ -70,22 +91,18 @@ void doLongStringTest(MultiStringType const& MS) {
|
||||
}
|
||||
using MAlloc = malloc_allocator<CharT>;
|
||||
MAlloc::reset();
|
||||
CHECKPOINT("Malloc allocator test - default construct");
|
||||
{ // Other allocator - default construct
|
||||
using Traits = std::char_traits<CharT>;
|
||||
using AStr = std::basic_string<CharT, Traits, MAlloc>;
|
||||
DisableAllocationGuard g;
|
||||
AStr s = p.string<CharT, Traits, MAlloc>();
|
||||
assert(s == value);
|
||||
assert(MAlloc::alloc_count > 0);
|
||||
assert(MAlloc::outstanding_alloc() == 1);
|
||||
}
|
||||
MAlloc::reset();
|
||||
CHECKPOINT("Malloc allocator test - provided copy");
|
||||
{ // Other allocator - provided copy
|
||||
using Traits = std::char_traits<CharT>;
|
||||
using AStr = std::basic_string<CharT, Traits, MAlloc>;
|
||||
DisableAllocationGuard g;
|
||||
MAlloc a;
|
||||
// don't allow another allocator to be default constructed.
|
||||
MAlloc::disable_default_constructor = true;
|
||||
|
||||
Reference in New Issue
Block a user