[compute] 42/49: Add test for zip_iterator with constant_iterator

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Dec 18 17:58:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository compute.

commit 70bdf310d3e2bd128c857e1bc3df585a36609a1c
Author: Kyle Lutz <kyle.r.lutz at gmail.com>
Date:   Tue Sep 15 12:56:11 2015 -0500

    Add test for zip_iterator with constant_iterator
---
 test/test_zip_iterator.cpp | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/test_zip_iterator.cpp b/test/test_zip_iterator.cpp
index da2bcfb..e558d2d 100644
--- a/test/test_zip_iterator.cpp
+++ b/test/test_zip_iterator.cpp
@@ -20,6 +20,7 @@
 #include <boost/compute/algorithm/copy.hpp>
 #include <boost/compute/algorithm/transform.hpp>
 #include <boost/compute/container/vector.hpp>
+#include <boost/compute/iterator/constant_iterator.hpp>
 #include <boost/compute/iterator/zip_iterator.hpp>
 #include <boost/compute/types/tuple.hpp>
 
@@ -203,4 +204,27 @@ BOOST_AUTO_TEST_CASE(zip_iterator_get)
     CHECK_RANGE_EQUAL(int, 5, output, (1, 3, 5, 7, 9));
 }
 
+BOOST_AUTO_TEST_CASE(zip_constant_iterator)
+{
+    compute::vector<int> result(4, context);
+
+    compute::transform(
+        compute::make_zip_iterator(
+            boost::make_tuple(
+                compute::make_constant_iterator(7)
+            )
+        ),
+        compute::make_zip_iterator(
+            boost::make_tuple(
+                compute::make_constant_iterator(7, result.size())
+            )
+        ),
+        result.begin(),
+        compute::get<0>(),
+        queue
+    );
+
+    CHECK_RANGE_EQUAL(int, 4, result, (7, 7, 7, 7));
+}
+
 BOOST_AUTO_TEST_SUITE_END()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/compute.git



More information about the debian-science-commits mailing list