[libcxx] r305268 - Add a test with an empty input range - should do nothing

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 12 19:28:40 PDT 2017


Author: marshall
Date: Mon Jun 12 21:28:40 2017
New Revision: 305268

URL: http://llvm.org/viewvc/llvm-project?rev=305268&view=rev
Log:
Add a test with an empty input range - should do nothing

Modified:
    libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp

Modified: libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp?rev=305268&r1=305267&r2=305268&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_iter_iter_iter_init_bop_uop.pass.cpp Mon Jun 12 21:28:40 2017
@@ -122,6 +122,12 @@ void basic_tests()
         assert(v[i] == 40 + triangle(i));
     }
 
+    {
+    std::vector<int> v, res;
+    std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 40, std::plus<>(), identity<>());
+    assert(res.empty());
+    }
+
 //  Make sure that the calculations are done using the init typedef
     {
     std::vector<unsigned char> v(10);




More information about the cfe-commits mailing list