[arrayfire] 227/248: Indexing test for out of bounds access

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:30 UTC 2015


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

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit dd3f023c476877b9aa902695529c09412a188a61
Author: pradeep <pradeep at arrayfire.com>
Date:   Tue Nov 10 15:24:26 2015 -0500

    Indexing test for out of bounds access
---
 test/index.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/index.cpp b/test/index.cpp
index a7cb315..d6d1a64 100644
--- a/test/index.cpp
+++ b/test/index.cpp
@@ -1369,3 +1369,20 @@ TEST(Asssign, LinearIndexGenArr)
         ASSERT_EQ(ha[i + st], hout[i]);
     }
 }
+
+TEST(Index, OutOfBounds)
+{
+    using af::array;
+
+    uint gold[7] = {0, 9, 49, 119, 149, 149, 148};
+    uint h_idx[7] = {0, 9, 49, 119, 149, 150, 151};
+    uint output[7];
+
+    array a = af::iota(af::dim4(50, 1, 3)).as(s32);
+    array idx(7, h_idx);
+    array b = a(idx);
+    b.host((void*)output);
+
+    for(int i=0; i<7; ++i)
+        ASSERT_EQ(gold[i], output[i]);
+}

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



More information about the debian-science-commits mailing list