[gcc(refs/users/ppalka/heads/libstdcxx-constrained-algos)] Test lexicographical_compare on ranges of different types

Patrick Palka ppalka@gcc.gnu.org
Mon Jan 27 22:43:00 GMT 2020


https://gcc.gnu.org/g:435d727d93505b903630542832b7de20940f1df5

commit 435d727d93505b903630542832b7de20940f1df5
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Jan 27 17:42:30 2020 -0500

    Test lexicographical_compare on ranges of different types

Diff:
---
 .../25_algorithms/lexicographical_compare/constrained.cc     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
index b28c736..b82c872 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc
@@ -33,11 +33,13 @@ void
 test01()
 {
   int x[] = {1, 2, 3, 4, 5};
-  int y[] = {1, 2, 3, 5};
-  int z[] = {1, 2, 3, 4, 5, 6};
+  char y[] = {1, 2, 3, 5};
+  long z[] = {1, 2, 3, 4, 5, 6};
 
     {
-      test_range<int, input_iterator_wrapper> rx(x), ry(y), rz(z);
+      test_range<int, input_iterator_wrapper> rx(x);
+      test_range<char, input_iterator_wrapper> ry(y);
+      test_range<long, input_iterator_wrapper> rz(z);
 
       VERIFY( ranges::lexicographical_compare(rx, ry) );
       rx.bounds.first = x;
@@ -45,7 +47,9 @@ test01()
       VERIFY( !ranges::lexicographical_compare(ry, rx) );
     }
 
-  test_range<int, forward_iterator_wrapper> rx(x), ry(y), rz(z);
+  test_range<int, forward_iterator_wrapper> rx(x);
+  test_range<char, forward_iterator_wrapper> ry(y);
+  test_range<long, forward_iterator_wrapper> rz(z);
 
   VERIFY( ranges::lexicographical_compare(rx, rz) );
   VERIFY( !ranges::lexicographical_compare(rz, rx) );



More information about the Libstdc++-cvs mailing list