diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-10-12 21:22:15 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-10-12 21:22:15 +0000 |
| commit | 23145c6e08f3f7be0e1c063987b5594c8016be93 (patch) | |
| tree | eace1879cb478106c1f0d88c7951590b6bb75fdc /libcxx/test/std | |
| parent | 0e6a833e468d5bcb9e66d29e2cc61546c35b33f0 (diff) | |
| download | bcm5719-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')
12 files changed, 62 insertions, 62 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp b/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp index 82a817a1f4a..9df3b074e40 100644 --- a/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp @@ -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())); + } } diff --git a/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp b/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp index 8d5ec1148a2..c836a182356 100644 --- a/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp +++ b/libcxx/test/std/containers/associative/multimap/max_size.pass.cpp @@ -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())); + } } diff --git a/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp b/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp index 8ca34ba8273..8c5b15e39c1 100644 --- a/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp +++ b/libcxx/test/std/containers/associative/multiset/max_size.pass.cpp @@ -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())); diff --git a/libcxx/test/std/containers/associative/set/max_size.pass.cpp b/libcxx/test/std/containers/associative/set/max_size.pass.cpp index c894eb51b1e..8be84046e1a 100644 --- a/libcxx/test/std/containers/associative/set/max_size.pass.cpp +++ b/libcxx/test/std/containers/associative/set/max_size.pass.cpp @@ -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())); diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp index 11ce9d2f689..2365d4e11b0 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp @@ -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())); diff --git a/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp index 916d12a9f67..dc35ac5f5da 100644 --- a/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp @@ -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())); diff --git a/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp index bd1b65e63d7..e8a48a2db74 100644 --- a/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp @@ -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())); diff --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp index 5f7a6268d55..3ab5cc6a890 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp @@ -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())); 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())); |

