From bddb2583f2fe3529787f55a4143b24db42951721 Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Tue, 23 Nov 2021 11:49:23 +0000 Subject: IVGCVSW-6610 No bounds checking performed when indexing PermutationVector elements. * Added out of bounds index error checking to PermutationVector operator[] method in Types.hpp. * Added armnn unit tests to UnitsTests.cpp to check error when using PermutationVector alone and with TransposeDescriptor and PermuteDescriptor. * Added pyarmnn unit test to check error when using PermutationVector. Signed-off-by: Cathal Corbett Change-Id: Ie5a8090f07b571a6bdf79a8cad621c31cc1891b7 --- python/pyarmnn/test/test_types.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/pyarmnn/test') diff --git a/python/pyarmnn/test/test_types.py b/python/pyarmnn/test/test_types.py index dfe1429c02..500a779844 100644 --- a/python/pyarmnn/test/test_types.py +++ b/python/pyarmnn/test/test_types.py @@ -27,3 +27,8 @@ def test_permutation_vector(): pv4 = ann.PermutationVector((0, 3, 1, 2)) assert pv.IsInverse(pv4) + + with pytest.raises(ValueError) as err: + pv4[4] + + assert err.type is ValueError -- cgit v1.2.1