diff --git a/src/python/corrade/test/test_containers.py b/src/python/corrade/test/test_containers.py index bc906db..013ce8d 100644 --- a/src/python/corrade/test/test_containers.py +++ b/src/python/corrade/test/test_containers.py @@ -354,7 +354,7 @@ class StridedArrayView1D(unittest.TestCase): data = b'hello' data_refcount = sys.getrefcount(data) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop a = containers.StridedArrayView1D(data)[7:8] self.assertEqual(a.size, (0, )) @@ -1158,7 +1158,7 @@ class BitArray(unittest.TestCase): a = containers.BitArray.value_init(5) a_refcount = sys.getrefcount(a) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop b = a[7:8] self.assertEqual(len(b), 0) self.assertEqual(b.offset, 5) @@ -1200,7 +1200,7 @@ class BitArray(unittest.TestCase): a = containers.BitArray.value_init(5) a_refcount = sys.getrefcount(a) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop b = a[7:8:2] self.assertEqual(len(b), 0) self.assertEqual(b.offset, 5) @@ -1360,7 +1360,7 @@ class BitArrayView(unittest.TestCase): data = containers.BitArray.value_init(5) data_refcount = sys.getrefcount(data) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop b = containers.BitArrayView(data)[7:8] self.assertEqual(len(b), 0) self.assertEqual(b.offset, 5) @@ -1411,7 +1411,7 @@ class BitArrayView(unittest.TestCase): a = containers.BitArray.value_init(5) a_refcount = sys.getrefcount(a) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop b = containers.BitArrayView(a)[7:8:2] self.assertEqual(len(b), 0) self.assertEqual(b.offset, 5) @@ -1663,7 +1663,7 @@ class StridedBitArrayView1D(unittest.TestCase): data = containers.BitArray.value_init(5) data_refcount = sys.getrefcount(data) - # Because this is out of bounds, slice.start = slice.stop + # Because this is out of range, slice.start = slice.stop b = containers.StridedBitArrayView1D(data)[7:8] self.assertEqual(len(b), 0) self.assertEqual(b.offset, 5) diff --git a/src/python/magnum/test/test_trade.py b/src/python/magnum/test/test_trade.py index 88e2c68..7962e08 100644 --- a/src/python/magnum/test/test_trade.py +++ b/src/python/magnum/test/test_trade.py @@ -1411,7 +1411,7 @@ class Importer(unittest.TestCase): importer.mesh_level_count(0) with self.assertRaises(IndexError): importer.mesh_name(0) - with self.assertRaisesRegex(IndexError, "ID out of bounds"): + with self.assertRaisesRegex(IndexError, "ID out of range"): importer.mesh(0) with self.assertRaises(IndexError): @@ -1433,13 +1433,13 @@ class Importer(unittest.TestCase): with self.assertRaises(IndexError): importer.image3d_name(0) - with self.assertRaisesRegex(IndexError, "ID out of bounds"): + with self.assertRaisesRegex(IndexError, "ID out of range"): importer.image1d(0) - with self.assertRaisesRegex(IndexError, "level out of bounds"): + with self.assertRaisesRegex(IndexError, "level out of range"): importer.image2d(0, 1) - with self.assertRaisesRegex(IndexError, "ID out of bounds"): + with self.assertRaisesRegex(IndexError, "ID out of range"): importer.image2d(1) - with self.assertRaisesRegex(IndexError, "ID out of bounds"): + with self.assertRaisesRegex(IndexError, "ID out of range"): importer.image3d(0) def test_open_failed(self): @@ -1566,7 +1566,7 @@ class Importer(unittest.TestCase): importer = trade.ImporterManager().load_and_instantiate('GltfImporter') importer.open_file(os.path.join(os.path.dirname(__file__), 'mesh.gltf')) - with self.assertRaisesRegex(IndexError, "level out of bounds"): + with self.assertRaisesRegex(IndexError, "level out of range"): importer.mesh('Non-indexed mesh', 1) def test_mesh_failed(self): @@ -1629,7 +1629,7 @@ class Importer(unittest.TestCase): importer = trade.ImporterManager().load_and_instantiate('StbImageImporter') importer.open_file(os.path.join(os.path.dirname(__file__), 'rgb.png')) - with self.assertRaisesRegex(IndexError, "level out of bounds"): + with self.assertRaisesRegex(IndexError, "level out of range"): importer.image2d(0, 1) def test_image2d_by_name(self): diff --git a/src/python/magnum/trade.cpp b/src/python/magnum/trade.cpp index 16f9f88..808ea28 100644 --- a/src/python/magnum/trade.cpp +++ b/src/python/magnum/trade.cpp @@ -429,12 +429,12 @@ template(Trade::AbstractImporter::*f)(UnsignedI } if(id >= (self.*bounds)()) { - PyErr_SetString(PyExc_IndexError, "ID out of bounds"); + PyErr_SetString(PyExc_IndexError, "ID out of range"); throw py::error_already_set{}; } if(level >= (self.*levelBounds)(id)) { - PyErr_SetString(PyExc_IndexError, "level out of bounds"); + PyErr_SetString(PyExc_IndexError, "level out of range"); throw py::error_already_set{}; } @@ -462,7 +462,7 @@ template(Trade::AbstractImporter::*f)(UnsignedI } if(level >= (self.*levelBounds)(id)) { - PyErr_SetString(PyExc_IndexError, "level out of bounds"); + PyErr_SetString(PyExc_IndexError, "level out of range"); throw py::error_already_set{}; }