summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/unord
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-10-12 21:22:15 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-10-12 21:22:15 +0000
commit23145c6e08f3f7be0e1c063987b5594c8016be93 (patch)
treeeace1879cb478106c1f0d88c7951590b6bb75fdc /libcxx/test/std/containers/unord
parent0e6a833e468d5bcb9e66d29e2cc61546c35b33f0 (diff)
downloadbcm5719-llvm-23145c6e08f3f7be0e1c063987b5594c8016be93.tar.gz
bcm5719-llvm-23145c6e08f3f7be0e1c063987b5594c8016be93.zip
Update all the max_size tests to eliminate signed/unsigned comparison warnings. NFC
llvm-svn: 344416
Diffstat (limited to 'libcxx/test/std/containers/unord')
-rw-r--r--libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp8
-rw-r--r--libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp8
-rw-r--r--libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp8
-rw-r--r--libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp8
4 files changed, 16 insertions, 16 deletions
diff --git a/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
index 15274198146..d01b526836e 100644
--- a/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
@@ -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()));
diff --git a/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
index 5b58bac385a..228575c2eff 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
@@ -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()));
diff --git a/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
index eac4db8b0a9..e76624e5cd5 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
@@ -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()));
diff --git a/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp b/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
index 1b902660d48..eb695ae9728 100644
--- a/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
@@ -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()));
OpenPOWER on IntegriCloud