Update all the max_size tests to eliminate signed/unsigned comparison warnings. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -34,18 +34,18 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<KV, (size_t)-1> A;
|
||||
typedef std::map<int, int, std::less<int>, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::map<char, int> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
}
|
||||
}
|
||||
{
|
||||
typedef std::map<char, int> C;
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,18 +34,18 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<KV, (size_t)-1> A;
|
||||
typedef std::multimap<int, int, std::less<int>, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::multimap<char, int> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
}
|
||||
}
|
||||
{
|
||||
typedef std::multimap<char, int> C;
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,16 +33,16 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::multiset<int, std::less<int>, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::multiset<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -33,16 +33,16 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::set<int, std::less<int>, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::set<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -30,16 +30,16 @@ int main() {
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::deque<int, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::deque<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -31,16 +31,16 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::forward_list<int, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::forward_list<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -30,16 +30,16 @@ int main() {
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::list<int, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::list<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -31,16 +31,16 @@ int main() {
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::vector<int, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::vector<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -36,16 +36,16 @@ int main()
|
||||
typedef limited_allocator<KV, (size_t)-1> A;
|
||||
typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A>
|
||||
C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_map<char, int> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -38,16 +38,16 @@ int main()
|
||||
typedef std::unordered_multimap<int, int, std::hash<int>,
|
||||
std::equal_to<int>, A>
|
||||
C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_multimap<char, int> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -37,16 +37,16 @@ int main()
|
||||
typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
|
||||
A>
|
||||
C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_multiset<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
@@ -33,16 +33,16 @@ int main()
|
||||
{
|
||||
typedef limited_allocator<int, (size_t)-1> A;
|
||||
typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, A> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
LIBCPP_ASSERT(c.max_size() == max_dist);
|
||||
}
|
||||
{
|
||||
typedef std::unordered_set<char> C;
|
||||
const C::difference_type max_dist =
|
||||
std::numeric_limits<C::difference_type>::max();
|
||||
const C::size_type max_dist =
|
||||
static_cast<C::size_type>(std::numeric_limits<C::difference_type>::max());
|
||||
C c;
|
||||
assert(c.max_size() <= max_dist);
|
||||
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
|
||||
|
||||
Reference in New Issue
Block a user