From bab1559852467e683e2bc2edb5bb72117100ae62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Sep 2023 12:21:50 +0200 Subject: [PATCH] Consistently use "out of range" instead of "out of bounds". Not that C++ STL and exceptions would be anything to take inspiration from, but there's std::out_of_range. Python IndexError is also specified as "index out of range", not "bounds". --- .../Animation/Test/InterpolationTest.cpp | 2 +- src/Magnum/DebugTools/FrameProfiler.cpp | 2 +- .../DebugTools/Test/FrameProfilerTest.cpp | 14 ++-- src/Magnum/GL/Test/ContextTest.cpp | 2 +- src/Magnum/MeshTools/Concatenate.h | 2 +- src/Magnum/MeshTools/Duplicate.cpp | 2 +- src/Magnum/MeshTools/GenerateIndices.cpp | 2 +- src/Magnum/MeshTools/GenerateNormals.cpp | 2 +- src/Magnum/MeshTools/Test/DuplicateTest.cpp | 8 +-- src/Magnum/MeshTools/Test/FilterTest.cpp | 12 ++-- .../MeshTools/Test/GenerateIndicesTest.cpp | 8 +-- .../MeshTools/Test/GenerateNormalsTest.cpp | 8 +-- .../SceneTools/Test/SceneConverterTest.cpp | 2 +- src/Magnum/Shaders/DistanceFieldVectorGL.cpp | 4 +- src/Magnum/Shaders/FlatGL.cpp | 6 +- src/Magnum/Shaders/LineGL.cpp | 4 +- src/Magnum/Shaders/MeshVisualizerGL.cpp | 8 +-- src/Magnum/Shaders/PhongGL.cpp | 14 ++-- .../Test/DistanceFieldVectorGLTest.cpp | 2 +- src/Magnum/Shaders/Test/FlatGLTest.cpp | 4 +- src/Magnum/Shaders/Test/LineGLTest.cpp | 2 +- .../Shaders/Test/MeshVisualizerGLTest.cpp | 8 +-- src/Magnum/Shaders/Test/PhongGLTest.cpp | 10 +-- src/Magnum/Shaders/Test/VectorGLTest.cpp | 2 +- src/Magnum/Shaders/Test/VertexColorGLTest.cpp | 2 +- src/Magnum/Shaders/VectorGL.cpp | 4 +- src/Magnum/Shaders/VertexColorGL.cpp | 4 +- src/Magnum/Text/AbstractGlyphCache.cpp | 2 +- src/Magnum/Text/DistanceFieldGlyphCache.cpp | 2 +- .../Text/Test/AbstractGlyphCacheTest.cpp | 14 ++-- src/Magnum/Text/Test/AbstractLayouterTest.cpp | 6 +- .../Test/DistanceFieldGlyphCacheGLTest.cpp | 14 ++-- src/Magnum/Trade/AbstractImporter.h | 4 +- src/Magnum/Trade/SceneData.cpp | 64 ++++++++--------- src/Magnum/Trade/Test/MaterialDataTest.cpp | 36 +++++----- src/Magnum/Trade/Test/SceneDataTest.cpp | 70 +++++++++---------- src/Magnum/Vk/DeviceProperties.cpp | 2 +- src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp | 4 +- src/Magnum/Vk/Test/ExtensionsTest.cpp | 2 +- .../TgaImporter/Test/TgaImporterTest.cpp | 4 +- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 4 +- 41 files changed, 184 insertions(+), 184 deletions(-) diff --git a/src/Magnum/Animation/Test/InterpolationTest.cpp b/src/Magnum/Animation/Test/InterpolationTest.cpp index eb0f60348..43cd9387c 100644 --- a/src/Magnum/Animation/Test/InterpolationTest.cpp +++ b/src/Magnum/Animation/Test/InterpolationTest.cpp @@ -155,7 +155,7 @@ const struct { {"before", 1}, {"at", 2}, {"after", 3}, - {"out of bounds", 405780454} + {"out of range", 405780454} }; InterpolationTest::InterpolationTest() { diff --git a/src/Magnum/DebugTools/FrameProfiler.cpp b/src/Magnum/DebugTools/FrameProfiler.cpp index 3a1ff1d7f..87ea7347c 100644 --- a/src/Magnum/DebugTools/FrameProfiler.cpp +++ b/src/Magnum/DebugTools/FrameProfiler.cpp @@ -264,7 +264,7 @@ UnsignedLong FrameProfiler::measurementData(const UnsignedInt id, const Unsigned CORRADE_ASSERT(id < _measurements.size(), "DebugTools::FrameProfiler::measurementData(): index" << id << "out of range for" << _measurements.size() << "measurements", {}); CORRADE_ASSERT(frame < _maxFrameCount, - "DebugTools::FrameProfiler::measurementData(): frame" << frame << "out of bounds for max" << _maxFrameCount << "frames", {}); + "DebugTools::FrameProfiler::measurementData(): frame" << frame << "out of range for max" << _maxFrameCount << "frames", {}); CORRADE_ASSERT(_measuredFrameCount >= Math::max(_measurements[id]._delay, 1u) && frame <= _measuredFrameCount - Math::max(_measurements[id]._delay, 1u), "DebugTools::FrameProfiler::measurementData(): frame" << frame << "of measurement" << id << "not available yet (delay" << Math::max(_measurements[id]._delay, 1u) << Debug::nospace << "," << _measuredFrameCount << "frames measured so far)", {}); diff --git a/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp b/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp index d3d217cf9..7e01ca951 100644 --- a/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp +++ b/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp @@ -54,8 +54,8 @@ struct FrameProfilerTest: TestSuite::Tester { void delayZero(); void delayTooLittleFrames(); void startStopFrameUnexpected(); - void measurementOutOfBounds(); - void frameOutOfBounds(); + void measurementOutOfRange(); + void frameOutOfRange(); void dataNotAvailableYet(); void meanNotAvailableYet(); @@ -128,8 +128,8 @@ FrameProfilerTest::FrameProfilerTest() { &FrameProfilerTest::delayZero, &FrameProfilerTest::delayTooLittleFrames, &FrameProfilerTest::startStopFrameUnexpected, - &FrameProfilerTest::measurementOutOfBounds, - &FrameProfilerTest::frameOutOfBounds, + &FrameProfilerTest::measurementOutOfRange, + &FrameProfilerTest::frameOutOfRange, &FrameProfilerTest::dataNotAvailableYet, &FrameProfilerTest::meanNotAvailableYet, @@ -828,7 +828,7 @@ void FrameProfilerTest::startStopFrameUnexpected() { "DebugTools::FrameProfiler::beginFrame(): expected end of frame\n"); } -void FrameProfilerTest::measurementOutOfBounds() { +void FrameProfilerTest::measurementOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); FrameProfiler profiler{{ @@ -853,7 +853,7 @@ void FrameProfilerTest::measurementOutOfBounds() { "DebugTools::FrameProfiler::measurementMean(): index 2 out of range for 2 measurements\n"); } -void FrameProfilerTest::frameOutOfBounds() { +void FrameProfilerTest::frameOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); FrameProfiler profiler{{ @@ -873,7 +873,7 @@ void FrameProfilerTest::frameOutOfBounds() { Error redirectError{&out}; profiler.measurementData(0, 3); CORRADE_COMPARE(out.str(), - "DebugTools::FrameProfiler::measurementData(): frame 3 out of bounds for max 3 frames\n"); + "DebugTools::FrameProfiler::measurementData(): frame 3 out of range for max 3 frames\n"); } void FrameProfilerTest::dataNotAvailableYet() { diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index 4ce7a2153..fefe0c092 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -101,7 +101,7 @@ void ContextTest::isExtension() { { /* Not really a problem right now, but once people hit this we might want to guard against this (especially because the Index might be - out of bounds) */ + out of range) */ struct ALExtension { enum: std::size_t { Index }; }; diff --git a/src/Magnum/MeshTools/Concatenate.h b/src/Magnum/MeshTools/Concatenate.h index df85607a0..db167f18b 100644 --- a/src/Magnum/MeshTools/Concatenate.h +++ b/src/Magnum/MeshTools/Concatenate.h @@ -54,7 +54,7 @@ The returned mesh contains vertices from all meshes concatenated together. If any mesh is indexed (expected to not have an implementation-specific index type), the resulting mesh is indexed as well, with indices adjusted for vertex offsets of particular meshes. The behavior is undefined if any mesh has indices -out of bounds for its particular vertex count. Meshes with +out of range for its particular vertex count. Meshes with @ref MeshPrimitive::LineStrip, @ref MeshPrimitive::LineLoop, @ref MeshPrimitive::TriangleStrip and @ref MeshPrimitive::TriangleFan can't be concatenated --- use @ref generateIndices() to turn them into diff --git a/src/Magnum/MeshTools/Duplicate.cpp b/src/Magnum/MeshTools/Duplicate.cpp index 5f2b00439..86bde1dc0 100644 --- a/src/Magnum/MeshTools/Duplicate.cpp +++ b/src/Magnum/MeshTools/Duplicate.cpp @@ -48,7 +48,7 @@ template inline void duplicateIntoImplementation(const Containers::Stri const std::size_t size = data.size()[1]; for(std::size_t i = 0; i != indices.size(); ++i) { const std::size_t index = indices[i]; - CORRADE_ASSERT(index < data.size()[0], "MeshTools::duplicateInto(): index" << index << "out of bounds for" << data.size()[0] << "elements", ); + CORRADE_ASSERT(index < data.size()[0], "MeshTools::duplicateInto(): index" << index << "out of range for" << data.size()[0] << "elements", ); std::memcpy(out[i].data(), data[index].data(), size); } } diff --git a/src/Magnum/MeshTools/GenerateIndices.cpp b/src/Magnum/MeshTools/GenerateIndices.cpp index 80a01c810..f33fa1adb 100644 --- a/src/Magnum/MeshTools/GenerateIndices.cpp +++ b/src/Magnum/MeshTools/GenerateIndices.cpp @@ -489,7 +489,7 @@ template inline void generateQuadIndicesIntoImplementation(const Contai auto get = [&](UnsignedInt j) -> const Vector3& { UnsignedInt index = quads[4*i + j]; CORRADE_ASSERT(index < positions.size(), - "MeshTools::generateQuadIndicesInto(): index" << index << "out of bounds for" << positions.size() << "elements", positions[0]); + "MeshTools::generateQuadIndicesInto(): index" << index << "out of range for" << positions.size() << "elements", positions[0]); return positions[index]; }; const Vector3& a = get(0); diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index df8576e8c..3d405a5e8 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -114,7 +114,7 @@ template inline void generateSmoothNormalsIntoImplementation(const Cont Containers::arrayCast(normals); for(UnsignedInt& i: triangleCount) i = 0; for(const T index: indices) { - CORRADE_ASSERT(index < positions.size(), "MeshTools::generateSmoothNormalsInto(): index" << index << "out of bounds for" << positions.size() << "elements", ); + CORRADE_ASSERT(index < positions.size(), "MeshTools::generateSmoothNormalsInto(): index" << index << "out of range for" << positions.size() << "elements", ); ++triangleCount[index]; } diff --git a/src/Magnum/MeshTools/Test/DuplicateTest.cpp b/src/Magnum/MeshTools/Test/DuplicateTest.cpp index f0ecd2cde..ca6ad0b94 100644 --- a/src/Magnum/MeshTools/Test/DuplicateTest.cpp +++ b/src/Magnum/MeshTools/Test/DuplicateTest.cpp @@ -41,7 +41,7 @@ struct DuplicateTest: TestSuite::Tester { explicit DuplicateTest(); void duplicate(); - void duplicateOutOfBounds(); + void duplicateOutOfRange(); #ifdef MAGNUM_BUILD_DEPRECATED void duplicateStl(); #endif @@ -71,7 +71,7 @@ struct DuplicateTest: TestSuite::Tester { DuplicateTest::DuplicateTest() { addTests({&DuplicateTest::duplicate, - &DuplicateTest::duplicateOutOfBounds, + &DuplicateTest::duplicateOutOfRange, #ifdef MAGNUM_BUILD_DEPRECATED &DuplicateTest::duplicateStl, #endif @@ -114,7 +114,7 @@ void DuplicateTest::duplicate() { TestSuite::Compare::Container); } -void DuplicateTest::duplicateOutOfBounds() { +void DuplicateTest::duplicateOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); constexpr UnsignedByte indices[]{1, 1, 0, 4, 2, 2}; @@ -125,7 +125,7 @@ void DuplicateTest::duplicateOutOfBounds() { MeshTools::duplicate(indices, data); CORRADE_COMPARE(out.str(), - "MeshTools::duplicateInto(): index 4 out of bounds for 4 elements\n"); + "MeshTools::duplicateInto(): index 4 out of range for 4 elements\n"); } #ifdef MAGNUM_BUILD_DEPRECATED diff --git a/src/Magnum/MeshTools/Test/FilterTest.cpp b/src/Magnum/MeshTools/Test/FilterTest.cpp index 12e863913..2447e252d 100644 --- a/src/Magnum/MeshTools/Test/FilterTest.cpp +++ b/src/Magnum/MeshTools/Test/FilterTest.cpp @@ -53,7 +53,7 @@ struct FilterTest: TestSuite::Tester { #ifdef MAGNUM_BUILD_DEPRECATED void onlyAttributeIds(); - void onlyAttributeIdsOutOfBounds(); + void onlyAttributeIdsOutOfRange(); void onlyAttributeIdsNoIndexData(); void onlyAttributeIdsNoAttributeData(); #endif @@ -64,7 +64,7 @@ struct FilterTest: TestSuite::Tester { #ifdef MAGNUM_BUILD_DEPRECATED void exceptAttributeIds(); - void exceptAttributeIdsOutOfBounds(); + void exceptAttributeIdsOutOfRange(); void exceptAttributeIdsNoIndexData(); void exceptAttributeIdsNoAttributeData(); #endif @@ -95,7 +95,7 @@ FilterTest::FilterTest() { addInstancedTests({&FilterTest::onlyAttributeIds}, Containers::arraySize(ImplementationSpecificIndexTypeData)); - addTests({&FilterTest::onlyAttributeIdsOutOfBounds, + addTests({&FilterTest::onlyAttributeIdsOutOfRange, &FilterTest::onlyAttributeIdsNoIndexData, &FilterTest::onlyAttributeIdsNoAttributeData}); #endif @@ -110,7 +110,7 @@ FilterTest::FilterTest() { addInstancedTests({&FilterTest::exceptAttributeIds}, Containers::arraySize(ImplementationSpecificIndexTypeData)); - addTests({&FilterTest::exceptAttributeIdsOutOfBounds, + addTests({&FilterTest::exceptAttributeIdsOutOfRange, &FilterTest::exceptAttributeIdsNoIndexData, &FilterTest::exceptAttributeIdsNoAttributeData}); #endif @@ -383,7 +383,7 @@ void FilterTest::onlyAttributeIds() { CORRADE_VERIFY(!attributeData.deleter()); } -void FilterTest::onlyAttributeIdsOutOfBounds() { +void FilterTest::onlyAttributeIdsOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); /* GCC 4.8 dies if I try to initialize this with a {}. I won't, then. */ @@ -627,7 +627,7 @@ void FilterTest::exceptAttributeIds() { CORRADE_VERIFY(!attributeData.deleter()); } -void FilterTest::exceptAttributeIdsOutOfBounds() { +void FilterTest::exceptAttributeIdsOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); /* GCC 4.8 dies if I try to initialize this with a {}. I won't, then. */ diff --git a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp b/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp index ba1bb7d79..aca84b9c1 100644 --- a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp @@ -76,7 +76,7 @@ struct GenerateIndicesTest: TestSuite::Tester { template void generateQuadIndices(); template void generateQuadIndicesInto(); void generateQuadIndicesWrongIndexCount(); - void generateQuadIndicesIndexOutOfBounds(); + void generateQuadIndicesIndexOutOfRange(); void generateQuadIndicesIntoWrongSize(); void generateIndicesMeshData(); @@ -266,7 +266,7 @@ GenerateIndicesTest::GenerateIndicesTest() { &GenerateIndicesTest::generateQuadIndicesInto, &GenerateIndicesTest::generateQuadIndicesInto, &GenerateIndicesTest::generateQuadIndicesWrongIndexCount, - &GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds, + &GenerateIndicesTest::generateQuadIndicesIndexOutOfRange, &GenerateIndicesTest::generateQuadIndicesIntoWrongSize}); addInstancedTests({&GenerateIndicesTest::generateIndicesMeshData, @@ -1031,7 +1031,7 @@ void GenerateIndicesTest::generateQuadIndicesWrongIndexCount() { "MeshTools::generateQuadIndicesInto(): quad index count 13 not divisible by 4\n"); } -void GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds() { +void GenerateIndicesTest::generateQuadIndicesIndexOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); UnsignedInt quads[]{5, 4, 6, 7}; @@ -1041,7 +1041,7 @@ void GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds() { Error redirectError{&out}; MeshTools::generateQuadIndices(positions, quads); CORRADE_COMPARE(out.str(), - "MeshTools::generateQuadIndicesInto(): index 7 out of bounds for 7 elements\n"); + "MeshTools::generateQuadIndicesInto(): index 7 out of range for 7 elements\n"); } void GenerateIndicesTest::generateQuadIndicesIntoWrongSize() { diff --git a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp index 694fd0e6c..4ad0e02d1 100644 --- a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp @@ -61,7 +61,7 @@ struct GenerateNormalsTest: TestSuite::Tester { void smoothZeroAreaTriangle(); void smoothNanPosition(); void smoothWrongCount(); - void smoothOutOfBounds(); + void smoothOutOfRange(); void smoothIntoWrongSize(); template void smoothErased(); @@ -89,7 +89,7 @@ GenerateNormalsTest::GenerateNormalsTest() { &GenerateNormalsTest::smoothZeroAreaTriangle, &GenerateNormalsTest::smoothNanPosition, &GenerateNormalsTest::smoothWrongCount, - &GenerateNormalsTest::smoothOutOfBounds, + &GenerateNormalsTest::smoothOutOfRange, &GenerateNormalsTest::smoothIntoWrongSize, &GenerateNormalsTest::smoothErased, @@ -402,7 +402,7 @@ void GenerateNormalsTest::smoothWrongCount() { CORRADE_COMPARE(out.str(), "MeshTools::generateSmoothNormalsInto(): index count not divisible by 3\n"); } -void GenerateNormalsTest::smoothOutOfBounds() { +void GenerateNormalsTest::smoothOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); std::stringstream out; @@ -411,7 +411,7 @@ void GenerateNormalsTest::smoothOutOfBounds() { const Vector3 positions[2]; const UnsignedInt indices[] { 0, 1, 2 }; generateSmoothNormals(indices, positions); - CORRADE_COMPARE(out.str(), "MeshTools::generateSmoothNormalsInto(): index 2 out of bounds for 2 elements\n"); + CORRADE_COMPARE(out.str(), "MeshTools::generateSmoothNormalsInto(): index 2 out of range for 2 elements\n"); } void GenerateNormalsTest::smoothIntoWrongSize() { diff --git a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp index 59afd4a2b..a8c4c4d1e 100644 --- a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp +++ b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp @@ -1308,7 +1308,7 @@ const struct { nullptr, "Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring 1 3D images not supported by the converter\n" /* Another way this could fail is that the texture is now referencing a - 3D image out of bounds (because adding it failed above) */ + 3D image out of range (because adding it failed above) */ "Trade::GltfSceneConverter::add(): 2D array textures require experimentalKhrTextureKtx to be enabled\n" "Cannot add material dependencies\n"}, {"can't add processed material", {InPlaceInit, { diff --git a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp index 7c98bcb6e..409da6834 100644 --- a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp +++ b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp @@ -385,10 +385,10 @@ template DistanceFieldVectorGL& DistanceFiel "Shaders::DistanceFieldVectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Shaders/FlatGL.cpp b/src/Magnum/Shaders/FlatGL.cpp index f5ce223a9..16cb89c5a 100644 --- a/src/Magnum/Shaders/FlatGL.cpp +++ b/src/Magnum/Shaders/FlatGL.cpp @@ -614,7 +614,7 @@ template FlatGL& FlatGL::setJoin CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), "Shaders::FlatGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this); CORRADE_ASSERT(id < _jointCount, - "Shaders::FlatGL::setJointMatrix(): joint ID" << id << "is out of bounds for" << _jointCount << "joints", *this); + "Shaders::FlatGL::setJointMatrix(): joint ID" << id << "is out of range for" << _jointCount << "joints", *this); setUniform(_jointMatricesUniform + id, matrix); return *this; } @@ -633,10 +633,10 @@ template FlatGL& FlatGL::setDraw "Shaders::FlatGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::FlatGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::FlatGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::FlatGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::FlatGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Shaders/LineGL.cpp b/src/Magnum/Shaders/LineGL.cpp index 1edc746a8..abc49b861 100644 --- a/src/Magnum/Shaders/LineGL.cpp +++ b/src/Magnum/Shaders/LineGL.cpp @@ -398,10 +398,10 @@ template LineGL& LineGL::setDraw "Shaders::LineGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::LineGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::LineGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::LineGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::LineGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Shaders/MeshVisualizerGL.cpp b/src/Magnum/Shaders/MeshVisualizerGL.cpp index 164fa9435..504c9d6fc 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.cpp +++ b/src/Magnum/Shaders/MeshVisualizerGL.cpp @@ -457,10 +457,10 @@ MeshVisualizerGLBase& MeshVisualizerGLBase::setDrawOffset(const UnsignedInt offs "Shaders::MeshVisualizerGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= FlagBase::ShaderStorageBuffers || offset < _drawCount, - "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL @@ -1002,7 +1002,7 @@ MeshVisualizerGL2D& MeshVisualizerGL2D::setJointMatrix(const UnsignedInt id, con CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers), "Shaders::MeshVisualizerGL2D::setJointMatrix(): the shader was created with uniform buffers enabled", *this); CORRADE_ASSERT(id < _jointCount, - "Shaders::MeshVisualizerGL2D::setJointMatrix(): joint ID" << id << "is out of bounds for" << _jointCount << "joints", *this); + "Shaders::MeshVisualizerGL2D::setJointMatrix(): joint ID" << id << "is out of range for" << _jointCount << "joints", *this); setUniform(_jointMatricesUniform + id, matrix); return *this; } @@ -1654,7 +1654,7 @@ MeshVisualizerGL3D& MeshVisualizerGL3D::setJointMatrix(const UnsignedInt id, con CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers), "Shaders::MeshVisualizerGL3D::setJointMatrix(): the shader was created with uniform buffers enabled", *this); CORRADE_ASSERT(id < _jointCount, - "Shaders::MeshVisualizerGL3D::setJointMatrix(): joint ID" << id << "is out of bounds for" << _jointCount << "joints", *this); + "Shaders::MeshVisualizerGL3D::setJointMatrix(): joint ID" << id << "is out of range for" << _jointCount << "joints", *this); setUniform(_jointMatricesUniform + id, matrix); return *this; } diff --git a/src/Magnum/Shaders/PhongGL.cpp b/src/Magnum/Shaders/PhongGL.cpp index 2d5113859..966dcba6f 100644 --- a/src/Magnum/Shaders/PhongGL.cpp +++ b/src/Magnum/Shaders/PhongGL.cpp @@ -840,7 +840,7 @@ PhongGL& PhongGL::setLightPosition(const UnsignedInt id, const Vector4& position "Shaders::PhongGL::setLightPosition(): the shader was created with uniform buffers enabled", *this); #endif CORRADE_ASSERT(id < _lightCount, - "Shaders::PhongGL::setLightPosition(): light ID" << id << "is out of bounds for" << _lightCount << "lights", *this); + "Shaders::PhongGL::setLightPosition(): light ID" << id << "is out of range for" << _lightCount << "lights", *this); setUniform(_lightPositionsUniform + id, position); return *this; } @@ -893,7 +893,7 @@ PhongGL& PhongGL::setLightColor(const UnsignedInt id, const Magnum::Color3& colo "Shaders::PhongGL::setLightColor(): the shader was created with uniform buffers enabled", *this); #endif CORRADE_ASSERT(id < _lightCount, - "Shaders::PhongGL::setLightColor(): light ID" << id << "is out of bounds for" << _lightCount << "lights", *this); + "Shaders::PhongGL::setLightColor(): light ID" << id << "is out of range for" << _lightCount << "lights", *this); setUniform(_lightColorsUniform + id, color); return *this; } @@ -932,7 +932,7 @@ PhongGL& PhongGL::setLightSpecularColor(const UnsignedInt id, const Magnum::Colo "Shaders::PhongGL::setLightSpecularColor(): the shader was created with uniform buffers enabled", *this); #endif CORRADE_ASSERT(id < _lightCount, - "Shaders::PhongGL::setLightSpecularColor(): light ID" << id << "is out of bounds for" << _lightCount << "lights", *this); + "Shaders::PhongGL::setLightSpecularColor(): light ID" << id << "is out of range for" << _lightCount << "lights", *this); CORRADE_ASSERT(!(_flags >= Flag::NoSpecular), "Shaders::PhongGL::setLightSpecularColor(): the shader was created with specular disabled", *this); setUniform(_lightSpecularColorsUniform + id, color); @@ -960,7 +960,7 @@ PhongGL& PhongGL::setLightRange(const UnsignedInt id, const Float range) { "Shaders::PhongGL::setLightRange(): the shader was created with uniform buffers enabled", *this); #endif CORRADE_ASSERT(id < _lightCount, - "Shaders::PhongGL::setLightRange(): light ID" << id << "is out of bounds for" << _lightCount << "lights", *this); + "Shaders::PhongGL::setLightRange(): light ID" << id << "is out of range for" << _lightCount << "lights", *this); setUniform(_lightRangesUniform + id, range); return *this; } @@ -983,7 +983,7 @@ PhongGL& PhongGL::setJointMatrix(const UnsignedInt id, const Matrix4& matrix) { CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), "Shaders::PhongGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this); CORRADE_ASSERT(id < _jointCount, - "Shaders::PhongGL::setJointMatrix(): joint ID" << id << "is out of bounds for" << _jointCount << "joints", *this); + "Shaders::PhongGL::setJointMatrix(): joint ID" << id << "is out of range for" << _jointCount << "joints", *this); setUniform(_jointMatricesUniform + id, matrix); return *this; } @@ -1002,10 +1002,10 @@ PhongGL& PhongGL::setDrawOffset(const UnsignedInt offset) { "Shaders::PhongGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::PhongGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::PhongGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::PhongGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::PhongGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index 12596ab97..483b6d8da 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -743,7 +743,7 @@ template void DistanceFieldVectorGLTest::setWrongDrawOff Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::DistanceFieldVectorGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 11cc13dbc..505f9e374 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -1747,7 +1747,7 @@ template void FlatGLTest::setWrongJointCountOrId() { .setJointMatrix(5, MatrixTypeFor{}); CORRADE_COMPARE(out.str(), "Shaders::FlatGL::setJointMatrices(): expected at most 5 items but got 6\n" - "Shaders::FlatGL::setJointMatrix(): joint ID 5 is out of bounds for 5 joints\n"); + "Shaders::FlatGL::setJointMatrix(): joint ID 5 is out of range for 5 joints\n"); } #endif @@ -1771,7 +1771,7 @@ template void FlatGLTest::setWrongDrawOffset() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::FlatGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::FlatGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/Test/LineGLTest.cpp b/src/Magnum/Shaders/Test/LineGLTest.cpp index 1d1ca5783..cb5135e2f 100644 --- a/src/Magnum/Shaders/Test/LineGLTest.cpp +++ b/src/Magnum/Shaders/Test/LineGLTest.cpp @@ -966,7 +966,7 @@ template void LineGLTest::setWrongDrawOffset() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::LineGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::LineGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } constexpr Vector2i RenderSizeLarge{128, 128}; diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 37d7d8f9d..82dffcca5 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -3078,7 +3078,7 @@ void MeshVisualizerGLTest::setWrongJointCountOrId2D() { .setJointMatrix(5, Matrix3{}); CORRADE_COMPARE(out.str(), "Shaders::MeshVisualizerGL2D::setJointMatrices(): expected at most 5 items but got 6\n" - "Shaders::MeshVisualizerGL2D::setJointMatrix(): joint ID 5 is out of bounds for 5 joints\n"); + "Shaders::MeshVisualizerGL2D::setJointMatrix(): joint ID 5 is out of range for 5 joints\n"); } void MeshVisualizerGLTest::setWrongJointCountOrId3D() { @@ -3103,7 +3103,7 @@ void MeshVisualizerGLTest::setWrongJointCountOrId3D() { .setJointMatrix(5, Matrix4{}); CORRADE_COMPARE(out.str(), "Shaders::MeshVisualizerGL3D::setJointMatrices(): expected at most 5 items but got 6\n" - "Shaders::MeshVisualizerGL3D::setJointMatrix(): joint ID 5 is out of bounds for 5 joints\n"); + "Shaders::MeshVisualizerGL3D::setJointMatrix(): joint ID 5 is out of range for 5 joints\n"); } #endif @@ -3125,7 +3125,7 @@ void MeshVisualizerGLTest::setWrongDrawOffset2D() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } void MeshVisualizerGLTest::setWrongDrawOffset3D() { @@ -3145,7 +3145,7 @@ void MeshVisualizerGLTest::setWrongDrawOffset3D() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::MeshVisualizerGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index d7f86c2b0..da15cdbb1 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -2189,9 +2189,9 @@ void PhongGLTest::setWrongLightCountOrId() { "Shaders::PhongGL::setLightColors(): expected 5 items but got 1\n" "Shaders::PhongGL::setLightPositions(): expected 5 items but got 1\n" "Shaders::PhongGL::setLightRanges(): expected 5 items but got 1\n" - "Shaders::PhongGL::setLightColor(): light ID 5 is out of bounds for 5 lights\n" - "Shaders::PhongGL::setLightPosition(): light ID 5 is out of bounds for 5 lights\n" - "Shaders::PhongGL::setLightRange(): light ID 5 is out of bounds for 5 lights\n"); + "Shaders::PhongGL::setLightColor(): light ID 5 is out of range for 5 lights\n" + "Shaders::PhongGL::setLightPosition(): light ID 5 is out of range for 5 lights\n" + "Shaders::PhongGL::setLightRange(): light ID 5 is out of range for 5 lights\n"); } #ifndef MAGNUM_TARGET_GLES2 @@ -2209,7 +2209,7 @@ void PhongGLTest::setWrongJointCountOrId() { .setJointMatrix(5, Matrix4{}); CORRADE_COMPARE(out.str(), "Shaders::PhongGL::setJointMatrices(): expected at most 5 items but got 6\n" - "Shaders::PhongGL::setJointMatrix(): joint ID 5 is out of bounds for 5 joints\n"); + "Shaders::PhongGL::setJointMatrix(): joint ID 5 is out of range for 5 joints\n"); } #endif @@ -2232,7 +2232,7 @@ void PhongGLTest::setWrongDrawOffset() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::PhongGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::PhongGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index 974102d62..67b133d74 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -734,7 +734,7 @@ template void VectorGLTest::setWrongDrawOffset() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::VectorGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::VectorGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index b5a9a2888..de6ae57c4 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -607,7 +607,7 @@ template void VertexColorGLTest::setWrongDrawOffset() { Error redirectError{&out}; shader.setDrawOffset(5); CORRADE_COMPARE(out.str(), - "Shaders::VertexColorGL::setDrawOffset(): draw offset 5 is out of bounds for 5 draws\n"); + "Shaders::VertexColorGL::setDrawOffset(): draw offset 5 is out of range for 5 draws\n"); } #endif diff --git a/src/Magnum/Shaders/VectorGL.cpp b/src/Magnum/Shaders/VectorGL.cpp index 256c73fe1..b14f92460 100644 --- a/src/Magnum/Shaders/VectorGL.cpp +++ b/src/Magnum/Shaders/VectorGL.cpp @@ -364,10 +364,10 @@ template VectorGL& VectorGL::set "Shaders::VectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); #ifndef MAGNUM_TARGET_WEBGL CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::VectorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::VectorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::VectorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::VectorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1 #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Shaders/VertexColorGL.cpp b/src/Magnum/Shaders/VertexColorGL.cpp index dfff42fae..86308363a 100644 --- a/src/Magnum/Shaders/VertexColorGL.cpp +++ b/src/Magnum/Shaders/VertexColorGL.cpp @@ -286,10 +286,10 @@ template VertexColorGL& VertexColorGL= Flag::ShaderStorageBuffers || offset < _drawCount, - "Shaders::VertexColorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::VertexColorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #else CORRADE_ASSERT(offset < _drawCount, - "Shaders::VertexColorGL::setDrawOffset(): draw offset" << offset << "is out of bounds for" << _drawCount << "draws", *this); + "Shaders::VertexColorGL::setDrawOffset(): draw offset" << offset << "is out of range for" << _drawCount << "draws", *this); #endif if(_drawCount > 1) setUniform(_drawOffsetUniform, offset); return *this; diff --git a/src/Magnum/Text/AbstractGlyphCache.cpp b/src/Magnum/Text/AbstractGlyphCache.cpp index a48231cd7..865d29a2b 100644 --- a/src/Magnum/Text/AbstractGlyphCache.cpp +++ b/src/Magnum/Text/AbstractGlyphCache.cpp @@ -59,7 +59,7 @@ void AbstractGlyphCache::insert(const UnsignedInt glyph, const Vector2i& positio void AbstractGlyphCache::setImage(const Vector2i& offset, const ImageView2D& image) { CORRADE_ASSERT((offset >= Vector2i{} && offset + image.size() <= _size).all(), - "Text::AbstractGlyphCache::setImage():" << Range2Di::fromSize(offset, image.size()) << "out of bounds for texture size" << _size, ); + "Text::AbstractGlyphCache::setImage():" << Range2Di::fromSize(offset, image.size()) << "out of range for texture size" << _size, ); doSetImage(offset, image); } diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index f9c8d73e7..54fcc2ef2 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/src/Magnum/Text/DistanceFieldGlyphCache.cpp @@ -97,7 +97,7 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, const ImageView2D& image) { CORRADE_ASSERT((offset >= Vector2i{} && offset + image.size() <= _size).all(), - "Text::DistanceFieldGlyphCache::setDistanceFieldImage():" << Range2Di::fromSize(offset, image.size()) << "out of bounds for texture size" << _size, ); + "Text::DistanceFieldGlyphCache::setDistanceFieldImage():" << Range2Di::fromSize(offset, image.size()) << "out of range for texture size" << _size, ); #ifndef CORRADE_NO_ASSERT const GL::PixelFormat format = GL::pixelFormat(image.format()); diff --git a/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp b/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp index 7b7b88088..21f88e9a3 100644 --- a/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp +++ b/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp @@ -45,7 +45,7 @@ struct AbstractGlyphCacheTest: TestSuite::Tester { void reserve(); void setImage(); - void setImageOutOfBounds(); + void setImageOutOfRange(); void image(); void imageNotSupported(); @@ -58,7 +58,7 @@ AbstractGlyphCacheTest::AbstractGlyphCacheTest() { &AbstractGlyphCacheTest::reserve, &AbstractGlyphCacheTest::setImage, - &AbstractGlyphCacheTest::setImageOutOfBounds, + &AbstractGlyphCacheTest::setImageOutOfRange, &AbstractGlyphCacheTest::image, &AbstractGlyphCacheTest::imageNotSupported, @@ -135,7 +135,7 @@ void AbstractGlyphCacheTest::setImage() { CORRADE_COMPARE(cache.imageSize, (Vector2i{20, 25})); } -void AbstractGlyphCacheTest::setImageOutOfBounds() { +void AbstractGlyphCacheTest::setImageOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); DummyGlyphCache cache{{100, 200}}; @@ -150,10 +150,10 @@ void AbstractGlyphCacheTest::setImageOutOfBounds() { cache.setImage({-1, 175}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); cache.setImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); CORRADE_COMPARE_AS(out.str(), - "Text::AbstractGlyphCache::setImage(): Range({81, 175}, {101, 200}) out of bounds for texture size Vector(100, 200)\n" - "Text::AbstractGlyphCache::setImage(): Range({80, 176}, {100, 201}) out of bounds for texture size Vector(100, 200)\n" - "Text::AbstractGlyphCache::setImage(): Range({-1, 175}, {19, 200}) out of bounds for texture size Vector(100, 200)\n" - "Text::AbstractGlyphCache::setImage(): Range({80, -1}, {100, 24}) out of bounds for texture size Vector(100, 200)\n", + "Text::AbstractGlyphCache::setImage(): Range({81, 175}, {101, 200}) out of range for texture size Vector(100, 200)\n" + "Text::AbstractGlyphCache::setImage(): Range({80, 176}, {100, 201}) out of range for texture size Vector(100, 200)\n" + "Text::AbstractGlyphCache::setImage(): Range({-1, 175}, {19, 200}) out of range for texture size Vector(100, 200)\n" + "Text::AbstractGlyphCache::setImage(): Range({80, -1}, {100, 24}) out of range for texture size Vector(100, 200)\n", TestSuite::Compare::String); } diff --git a/src/Magnum/Text/Test/AbstractLayouterTest.cpp b/src/Magnum/Text/Test/AbstractLayouterTest.cpp index 6b5864ee1..73d7b6107 100644 --- a/src/Magnum/Text/Test/AbstractLayouterTest.cpp +++ b/src/Magnum/Text/Test/AbstractLayouterTest.cpp @@ -36,12 +36,12 @@ struct AbstractLayouterTest: TestSuite::Tester { explicit AbstractLayouterTest(); void renderGlyph(); - void renderGlyphOutOfBounds(); + void renderGlyphOutOfRange(); }; AbstractLayouterTest::AbstractLayouterTest() { addTests({&AbstractLayouterTest::renderGlyph, - &AbstractLayouterTest::renderGlyphOutOfBounds}); + &AbstractLayouterTest::renderGlyphOutOfRange}); } void AbstractLayouterTest::renderGlyph() { @@ -82,7 +82,7 @@ void AbstractLayouterTest::renderGlyph() { CORRADE_COMPARE(rectangle, Range2D({2.0f, 0.5f}, {6.1f, 3.0f})); } -void AbstractLayouterTest::renderGlyphOutOfBounds() { +void AbstractLayouterTest::renderGlyphOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); struct Layouter: AbstractLayouter { diff --git a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp index 70beed07b..8d702e312 100644 --- a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp @@ -54,7 +54,7 @@ struct DistanceFieldGlyphCacheGLTest: GL::OpenGLTester { void setImage(); void setDistanceFieldImage(); - void setDistanceFieldImageOutOfBounds(); + void setDistanceFieldImageOutOfRange(); PluginManager::Manager _manager{"nonexistent"}; }; @@ -79,7 +79,7 @@ DistanceFieldGlyphCacheGLTest::DistanceFieldGlyphCacheGLTest() { Containers::arraySize(SetImageData)); addTests({&DistanceFieldGlyphCacheGLTest::setDistanceFieldImage, - &DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfBounds}); + &DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfRange}); /* Load the plugin directly from the build tree. Otherwise it's either static and already loaded or not present in the build tree */ @@ -197,7 +197,7 @@ void DistanceFieldGlyphCacheGLTest::setDistanceFieldImage() { #endif } -void DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfBounds() { +void DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); DistanceFieldGlyphCache cache{{200, 300}, {100, 200}, 4}; @@ -215,10 +215,10 @@ void DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfBounds() { cache.setDistanceFieldImage({-1, 175}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); cache.setDistanceFieldImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); CORRADE_COMPARE_AS(out.str(), - "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({81, 175}, {101, 200}) out of bounds for texture size Vector(100, 200)\n" - "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({80, 176}, {100, 201}) out of bounds for texture size Vector(100, 200)\n" - "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({-1, 175}, {19, 200}) out of bounds for texture size Vector(100, 200)\n" - "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({80, -1}, {100, 24}) out of bounds for texture size Vector(100, 200)\n", + "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({81, 175}, {101, 200}) out of range for texture size Vector(100, 200)\n" + "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({80, 176}, {100, 201}) out of range for texture size Vector(100, 200)\n" + "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({-1, 175}, {19, 200}) out of range for texture size Vector(100, 200)\n" + "Text::DistanceFieldGlyphCache::setDistanceFieldImage(): Range({80, -1}, {100, 24}) out of range for texture size Vector(100, 200)\n", TestSuite::Compare::String); } diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index 863bddfcf..5f4298088 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -231,7 +231,7 @@ Since the importers deal with untrusted external data, it's needed to perform explicit error handling on the application side. There are two cases where it can fail --- during opening, in which case the function returns @cpp false @ce, and during the actual data import, in which case you get an empty @relativeref{Corrade,Containers::Optional}. In both cases the actual failure -reason is printed to the error output. Everything else (IDs out of bounds, +reason is printed to the error output. Everything else (IDs out of range, calling functions without a file open, accessing an empty optional, ...) is treated as a programmer error and will produce the usual assertions. @@ -1897,7 +1897,7 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * * Default implementation returns @cpp -1 @ce. This function isn't * expected to fail --- if an import error occus (for example because - * the default scene index is out of bounds), it should be handled + * the default scene index is out of range), it should be handled * already during file opening. */ virtual Int doDefaultScene() const; diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index c6cdf9593..6950755a2 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -1229,13 +1229,13 @@ std::size_t SceneData::findFieldObjectOffsetInternal(const SceneFieldData& field Containers::Optional SceneData::findFieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::findFieldObjectOffset(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::findFieldObjectOffset(): object" << object << "out of range for" << _mappingBound << "objects", {}); CORRADE_ASSERT(fieldId < _fields.size(), "Trade::SceneData::findFieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); const SceneFieldData& field = _fields[fieldId]; CORRADE_ASSERT(offset <= field._size, - "Trade::SceneData::findFieldObjectOffset(): offset" << offset << "out of bounds for a field of size" << field._size, {}); + "Trade::SceneData::findFieldObjectOffset(): offset" << offset << "out of range for a field of size" << field._size, {}); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset); return found == field._size ? Containers::Optional{} : found; @@ -1243,7 +1243,7 @@ Containers::Optional SceneData::findFieldObjectOffset(const Unsigne Containers::Optional SceneData::findFieldObjectOffset(const SceneField fieldName, const UnsignedLong object, const std::size_t offset) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::findFieldObjectOffset(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::findFieldObjectOffset(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(fieldName); CORRADE_ASSERT(fieldId != ~UnsignedInt{}, @@ -1251,7 +1251,7 @@ Containers::Optional SceneData::findFieldObjectOffset(const SceneFi const SceneFieldData& field = _fields[fieldId]; CORRADE_ASSERT(offset <= field._size, - "Trade::SceneData::findFieldObjectOffset(): offset" << offset << "out of bounds for a field of size" << field._size, {}); + "Trade::SceneData::findFieldObjectOffset(): offset" << offset << "out of range for a field of size" << field._size, {}); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset); return found == field._size ? Containers::Optional{} : found; @@ -1259,13 +1259,13 @@ Containers::Optional SceneData::findFieldObjectOffset(const SceneFi std::size_t SceneData::fieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::fieldObjectOffset(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::fieldObjectOffset(): object" << object << "out of range for" << _mappingBound << "objects", {}); CORRADE_ASSERT(fieldId < _fields.size(), "Trade::SceneData::fieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); const SceneFieldData& field = _fields[fieldId]; CORRADE_ASSERT(offset <= field._size, - "Trade::SceneData::fieldObjectOffset(): offset" << offset << "out of bounds for a field of size" << field._size, {}); + "Trade::SceneData::fieldObjectOffset(): offset" << offset << "out of range for a field of size" << field._size, {}); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset); CORRADE_ASSERT(found != field._size, @@ -1275,7 +1275,7 @@ std::size_t SceneData::fieldObjectOffset(const UnsignedInt fieldId, const Unsign std::size_t SceneData::fieldObjectOffset(const SceneField fieldName, const UnsignedLong object, const std::size_t offset) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::fieldObjectOffset(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::fieldObjectOffset(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(fieldName); CORRADE_ASSERT(fieldId != ~UnsignedInt{}, @@ -1283,7 +1283,7 @@ std::size_t SceneData::fieldObjectOffset(const SceneField fieldName, const Unsig const SceneFieldData& field = _fields[fieldId]; CORRADE_ASSERT(offset <= field._size, - "Trade::SceneData::fieldObjectOffset(): offset" << offset << "out of bounds for a field of size" << field._size, {}); + "Trade::SceneData::fieldObjectOffset(): offset" << offset << "out of range for a field of size" << field._size, {}); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset); CORRADE_ASSERT(found != field._size, @@ -1293,7 +1293,7 @@ std::size_t SceneData::fieldObjectOffset(const SceneField fieldName, const Unsig bool SceneData::hasFieldObject(const UnsignedInt fieldId, const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::hasFieldObject(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::hasFieldObject(): object" << object << "out of range for" << _mappingBound << "objects", {}); CORRADE_ASSERT(fieldId < _fields.size(), "Trade::SceneData::hasFieldObject(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); @@ -1303,7 +1303,7 @@ bool SceneData::hasFieldObject(const UnsignedInt fieldId, const UnsignedLong obj bool SceneData::hasFieldObject(const SceneField fieldName, const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::hasFieldObject(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::hasFieldObject(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(fieldName); CORRADE_ASSERT(fieldId != ~UnsignedInt{}, @@ -1668,7 +1668,7 @@ std::size_t SceneData::mappingInto(const UnsignedInt fieldId, const std::size_t CORRADE_ASSERT(fieldId < _fields.size(), "Trade::SceneData::mappingInto(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); CORRADE_ASSERT(offset <= _fields[fieldId]._size, - "Trade::SceneData::mappingInto(): offset" << offset << "out of bounds for a field of size" << _fields[fieldId]._size, {}); + "Trade::SceneData::mappingInto(): offset" << offset << "out of range for a field of size" << _fields[fieldId]._size, {}); const std::size_t size = Math::min(destination.size(), std::size_t(_fields[fieldId]._size) - offset); mappingIntoInternal(fieldId, offset, destination.prefix(size)); return size; @@ -1744,7 +1744,7 @@ std::size_t SceneData::parentsInto(const std::size_t offset, const Containers::S "Trade::SceneData::parentsInto(): field not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::parentsInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::parentsInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::parentsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -1960,7 +1960,7 @@ std::size_t SceneData::transformations2DInto(const std::size_t offset, const Con "Trade::SceneData::transformations2DInto(): no transformation-related field found", {}); const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::transformations2DInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::transformations2DInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::transformations2DInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2070,7 +2070,7 @@ std::size_t SceneData::translationsRotationsScalings2DInto(const std::size_t off "Trade::SceneData::translationsRotationsScalings2DInto(): no transformation-related field found", {}); const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::translationsRotationsScalings2DInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::translationsRotationsScalings2DInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !translationDestination || mappingDestination.size() == translationDestination.size(), "Trade::SceneData::translationsRotationsScalings2DInto(): mapping and translation destination views have different size," << mappingDestination.size() << "vs" << translationDestination.size(), {}); CORRADE_ASSERT(!mappingDestination != !rotationDestination || mappingDestination.size() == rotationDestination.size(), @@ -2206,7 +2206,7 @@ std::size_t SceneData::transformations3DInto(const std::size_t offset, const Con "Trade::SceneData::transformations3DInto(): no transformation-related field found", {}); const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::transformations3DInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::transformations3DInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::transformations3DInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2316,7 +2316,7 @@ std::size_t SceneData::translationsRotationsScalings3DInto(const std::size_t off "Trade::SceneData::translationsRotationsScalings3DInto(): no transformation-related field found", {}); const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::translationsRotationsScalings3DInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::translationsRotationsScalings3DInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !translationDestination || mappingDestination.size() == translationDestination.size(), "Trade::SceneData::translationsRotationsScalings3DInto(): mapping and translation destination views have different size," << mappingDestination.size() << "vs" << translationDestination.size(), {}); CORRADE_ASSERT(!mappingDestination != !rotationDestination || mappingDestination.size() == rotationDestination.size(), @@ -2437,7 +2437,7 @@ std::size_t SceneData::meshesMaterialsInto(const std::size_t offset, const Conta "Trade::SceneData::meshesMaterialsInto(): field" << SceneField::Mesh << "not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::meshesMaterialsInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::meshesMaterialsInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !meshDestination || mappingDestination.size() == meshDestination.size(), "Trade::SceneData::meshesMaterialsInto(): mapping and mesh destination views have different size," << mappingDestination.size() << "vs" << meshDestination.size(), {}); CORRADE_ASSERT(!mappingDestination != !meshMaterialDestination || mappingDestination.size() == meshMaterialDestination.size(), @@ -2486,7 +2486,7 @@ std::size_t SceneData::lightsInto(const std::size_t offset, const Containers::St "Trade::SceneData::lightsInto(): field not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::lightsInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::lightsInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::lightsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2522,7 +2522,7 @@ std::size_t SceneData::camerasInto(const std::size_t offset, const Containers::S "Trade::SceneData::camerasInto(): field not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::camerasInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::camerasInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::camerasInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2558,7 +2558,7 @@ std::size_t SceneData::skinsInto(const std::size_t offset, const Containers::Str "Trade::SceneData::skinsInto(): field not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::skinsInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::skinsInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::skinsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2604,7 +2604,7 @@ std::size_t SceneData::importerStateInto(const std::size_t offset, const Contain "Trade::SceneData::importerStateInto(): field not found", {}); const std::size_t fieldSize = _fields[fieldId]._size; CORRADE_ASSERT(offset <= fieldSize, - "Trade::SceneData::importerStateInto(): offset" << offset << "out of bounds for a field of size" << fieldSize, {}); + "Trade::SceneData::importerStateInto(): offset" << offset << "out of range for a field of size" << fieldSize, {}); CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(), "Trade::SceneData::importerStateInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << fieldDestination.size(), {}); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset); @@ -2636,7 +2636,7 @@ Containers::Array> SceneData::importe Containers::Optional SceneData::parentFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::parentFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::parentFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Parent); if(fieldId == ~UnsignedInt{}) return {}; @@ -2652,7 +2652,7 @@ Containers::Optional SceneData::parentFor(const UnsignedLong object) const Containers::Array SceneData::childrenFor(const Long object) const { CORRADE_ASSERT(object >= -1 && object < Long(_mappingBound), - "Trade::SceneData::childrenFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::childrenFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt parentFieldId = findFieldIdInternal(SceneField::Parent); if(parentFieldId == ~UnsignedInt{}) return {}; @@ -2682,7 +2682,7 @@ Containers::Array SceneData::childrenFor(const Long object) const Containers::Optional SceneData::transformation2DFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::transformation2DFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::transformation2DFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); UnsignedInt transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId; const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId); @@ -2703,7 +2703,7 @@ Containers::Optional SceneData::transformation2DFor(const UnsignedLong Containers::Optional> SceneData::translationRotationScaling2DFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::translationRotationScaling2DFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::translationRotationScaling2DFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); UnsignedInt translationFieldId, rotationFieldId, scalingFieldId; const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId); @@ -2726,7 +2726,7 @@ Containers::Optional> SceneData::t Containers::Optional SceneData::transformation3DFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::transformation3DFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::transformation3DFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); UnsignedInt transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId; const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId); @@ -2747,7 +2747,7 @@ Containers::Optional SceneData::transformation3DFor(const UnsignedLong Containers::Optional> SceneData::translationRotationScaling3DFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::translationRotationScaling3DFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::translationRotationScaling3DFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); UnsignedInt translationFieldId, rotationFieldId, scalingFieldId; const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId); @@ -2770,7 +2770,7 @@ Containers::Optional> SceneData Containers::Array> SceneData::meshesMaterialsFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::meshesMaterialsFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::meshesMaterialsFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt meshFieldId = findFieldIdInternal(SceneField::Mesh); if(meshFieldId == ~UnsignedInt{}) return {}; @@ -2794,7 +2794,7 @@ Containers::Array> SceneData::meshesMaterials Containers::Array SceneData::lightsFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::lightsFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::lightsFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Light); if(fieldId == ~UnsignedInt{}) return {}; @@ -2817,7 +2817,7 @@ Containers::Array SceneData::lightsFor(const UnsignedLong object) c Containers::Array SceneData::camerasFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::camerasFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::camerasFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Camera); if(fieldId == ~UnsignedInt{}) return {}; @@ -2840,7 +2840,7 @@ Containers::Array SceneData::camerasFor(const UnsignedLong object) Containers::Array SceneData::skinsFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::skinsFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::skinsFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Skin); if(fieldId == ~UnsignedInt{}) return {}; @@ -2863,7 +2863,7 @@ Containers::Array SceneData::skinsFor(const UnsignedLong object) co Containers::Optional SceneData::importerStateFor(const UnsignedLong object) const { CORRADE_ASSERT(object < _mappingBound, - "Trade::SceneData::importerStateFor(): object" << object << "out of bounds for" << _mappingBound << "objects", {}); + "Trade::SceneData::importerStateFor(): object" << object << "out of range for" << _mappingBound << "objects", {}); const UnsignedInt fieldId = findFieldIdInternal(SceneField::ImporterState); if(fieldId == ~UnsignedInt{}) return {}; diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp index 67353ebe1..ad802c5de 100644 --- a/src/Magnum/Trade/Test/MaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp @@ -99,7 +99,7 @@ struct MaterialDataTest: TestSuite::Tester { void constructLayers(); void constructLayersNotMonotonic(); - void constructLayersOffsetOutOfBounds(); + void constructLayersOffsetOutOfRange(); void constructLayersLastOffsetTooShort(); void constructNonOwned(); @@ -108,7 +108,7 @@ struct MaterialDataTest: TestSuite::Tester { void constructNonOwnedNotSorted(); void constructNonOwnedDuplicateAttribute(); void constructNonOwnedLayersNotMonotonic(); - void constructNonOwnedLayersOffsetOutOfBounds(); + void constructNonOwnedLayersOffsetOutOfRange(); void constructNonOwnedLayersLastOffsetTooShort(); void constructNonOwnedAttributeFlagOwned(); void constructNonOwnedLayerFlagOwned(); @@ -126,7 +126,7 @@ struct MaterialDataTest: TestSuite::Tester { void accessTextureSwizzle(); void accessMutable(); void accessOptional(); - void accessOutOfBounds(); + void accessOutOfRange(); void accessNotFound(); void accessInvalidAttributeName(); void accessWrongType(); @@ -150,11 +150,11 @@ struct MaterialDataTest: TestSuite::Tester { void accessLayerIndexOptional(); void accessLayerNameOptional(); void accessLayerStringOptional(); - void accessLayerOutOfBounds(); + void accessLayerOutOfRange(); void accessLayerNotFound(); void accessInvalidLayerName(); - void accessOutOfBoundsInLayerIndex(); - void accessOutOfBoundsInLayerString(); + void accessOutOfRangeInLayerIndex(); + void accessOutOfRangeInLayerString(); void accessNotFoundInLayerIndex(); void accessNotFoundInLayerString(); void accessMutableNotAllowed(); @@ -268,7 +268,7 @@ MaterialDataTest::MaterialDataTest() { &MaterialDataTest::constructLayers, &MaterialDataTest::constructLayersNotMonotonic, - &MaterialDataTest::constructLayersOffsetOutOfBounds, + &MaterialDataTest::constructLayersOffsetOutOfRange, &MaterialDataTest::constructLayersLastOffsetTooShort, &MaterialDataTest::constructNonOwned, @@ -277,7 +277,7 @@ MaterialDataTest::MaterialDataTest() { &MaterialDataTest::constructNonOwnedNotSorted, &MaterialDataTest::constructNonOwnedDuplicateAttribute, &MaterialDataTest::constructNonOwnedLayersNotMonotonic, - &MaterialDataTest::constructNonOwnedLayersOffsetOutOfBounds, + &MaterialDataTest::constructNonOwnedLayersOffsetOutOfRange, &MaterialDataTest::constructNonOwnedLayersLastOffsetTooShort, &MaterialDataTest::constructNonOwnedAttributeFlagOwned, &MaterialDataTest::constructNonOwnedLayerFlagOwned, @@ -295,7 +295,7 @@ MaterialDataTest::MaterialDataTest() { &MaterialDataTest::accessTextureSwizzle, &MaterialDataTest::accessMutable, &MaterialDataTest::accessOptional, - &MaterialDataTest::accessOutOfBounds, + &MaterialDataTest::accessOutOfRange, &MaterialDataTest::accessNotFound, &MaterialDataTest::accessInvalidAttributeName, &MaterialDataTest::accessWrongType, @@ -319,11 +319,11 @@ MaterialDataTest::MaterialDataTest() { &MaterialDataTest::accessLayerIndexOptional, &MaterialDataTest::accessLayerNameOptional, &MaterialDataTest::accessLayerStringOptional, - &MaterialDataTest::accessLayerOutOfBounds, + &MaterialDataTest::accessLayerOutOfRange, &MaterialDataTest::accessLayerNotFound, &MaterialDataTest::accessInvalidLayerName, - &MaterialDataTest::accessOutOfBoundsInLayerIndex, - &MaterialDataTest::accessOutOfBoundsInLayerString, + &MaterialDataTest::accessOutOfRangeInLayerIndex, + &MaterialDataTest::accessOutOfRangeInLayerString, &MaterialDataTest::accessNotFoundInLayerIndex, &MaterialDataTest::accessNotFoundInLayerString, &MaterialDataTest::accessMutableNotAllowed, @@ -1500,7 +1500,7 @@ void MaterialDataTest::constructLayersNotMonotonic() { CORRADE_COMPARE(out.str(), "Trade::MaterialData: invalid range (5, 4) for layer 2 with 5 attributes in total\n"); } -void MaterialDataTest::constructLayersOffsetOutOfBounds() { +void MaterialDataTest::constructLayersOffsetOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); std::ostringstream out; @@ -1695,7 +1695,7 @@ void MaterialDataTest::constructNonOwnedLayersNotMonotonic() { CORRADE_COMPARE(out.str(), "Trade::MaterialData: invalid range (5, 4) for layer 2 with 5 attributes in total\n"); } -void MaterialDataTest::constructNonOwnedLayersOffsetOutOfBounds() { +void MaterialDataTest::constructNonOwnedLayersOffsetOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); MaterialAttributeData attributes[]{ @@ -2007,7 +2007,7 @@ void MaterialDataTest::accessOptional() { CORRADE_COMPARE(data.attributeOr(MaterialAttribute::DiffuseTexture, 5u), 5); } -void MaterialDataTest::accessOutOfBounds() { +void MaterialDataTest::accessOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); MaterialData data{{}, { @@ -2621,7 +2621,7 @@ void MaterialDataTest::accessLayerStringOptional() { CORRADE_COMPARE(data.attributeOr("ClearCoat", MaterialAttribute::DiffuseTexture, 5u), 5); } -void MaterialDataTest::accessLayerOutOfBounds() { +void MaterialDataTest::accessLayerOutOfRange() { CORRADE_SKIP_IF_NO_ASSERT(); MaterialData data{{}, { @@ -2899,7 +2899,7 @@ void MaterialDataTest::accessInvalidLayerName() { "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n"); } -void MaterialDataTest::accessOutOfBoundsInLayerIndex() { +void MaterialDataTest::accessOutOfRangeInLayerIndex() { CORRADE_SKIP_IF_NO_ASSERT(); MaterialData data{{}, { @@ -2930,7 +2930,7 @@ void MaterialDataTest::accessOutOfBoundsInLayerIndex() { "Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 attributes in layer 1\n"); } -void MaterialDataTest::accessOutOfBoundsInLayerString() { +void MaterialDataTest::accessOutOfRangeInLayerString() { CORRADE_SKIP_IF_NO_ASSERT(); MaterialData data{{}, { diff --git a/src/Magnum/Trade/Test/SceneDataTest.cpp b/src/Magnum/Trade/Test/SceneDataTest.cpp index 8cbb6e6f0..93750a8cb 100644 --- a/src/Magnum/Trade/Test/SceneDataTest.cpp +++ b/src/Magnum/Trade/Test/SceneDataTest.cpp @@ -294,7 +294,7 @@ const struct { {5, 5, 5, 5, 5}, 3, 0, 3}, {"implicit, not found", SceneFieldFlag::ImplicitMapping, /* Is there but the assumption is that the ID matches the offset, which - is out of bounds */ + is out of range */ {5, 5, 5, 5, 5}, 5, 0, Containers::NullOpt}, {"implicit, offset", SceneFieldFlag::ImplicitMapping, /* Not there but the assumption is that the ID matches the offset; @@ -304,7 +304,7 @@ const struct { /* Cerifying that the offset is properly accounted for -- it's never found if offset > id */ {5, 5, 5, 5, 5}, 3, 4, Containers::NullOpt}, - {"implicit, offset, not found, out of bounds", SceneFieldFlag::ImplicitMapping, + {"implicit, offset, not found, out of range", SceneFieldFlag::ImplicitMapping, {5, 5, 5, 5, 5}, 5, 4, Containers::NullOpt} }; @@ -4336,10 +4336,10 @@ void SceneDataTest::findFieldObjectOffsetInvalidOffset() { scene.fieldObjectOffset(0, 1, 4); scene.fieldObjectOffset(SceneField::Mesh, 1, 4); CORRADE_COMPARE(out.str(), - "Trade::SceneData::findFieldObjectOffset(): offset 4 out of bounds for a field of size 3\n" - "Trade::SceneData::findFieldObjectOffset(): offset 4 out of bounds for a field of size 3\n" - "Trade::SceneData::fieldObjectOffset(): offset 4 out of bounds for a field of size 3\n" - "Trade::SceneData::fieldObjectOffset(): offset 4 out of bounds for a field of size 3\n"); + "Trade::SceneData::findFieldObjectOffset(): offset 4 out of range for a field of size 3\n" + "Trade::SceneData::findFieldObjectOffset(): offset 4 out of range for a field of size 3\n" + "Trade::SceneData::fieldObjectOffset(): offset 4 out of range for a field of size 3\n" + "Trade::SceneData::fieldObjectOffset(): offset 4 out of range for a field of size 3\n"); } void SceneDataTest::fieldObjectOffsetNotFound() { @@ -4542,8 +4542,8 @@ void SceneDataTest::mappingIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::mappingInto(): expected a view with 3 elements but got 2\n" "Trade::SceneData::mappingInto(): expected a view with 3 elements but got 2\n" - "Trade::SceneData::mappingInto(): offset 4 out of bounds for a field of size 3\n" - "Trade::SceneData::mappingInto(): offset 4 out of bounds for a field of size 3\n"); + "Trade::SceneData::mappingInto(): offset 4 out of range for a field of size 3\n" + "Trade::SceneData::mappingInto(): offset 4 out of range for a field of size 3\n"); } template void SceneDataTest::parentsAsArray() { @@ -4661,7 +4661,7 @@ void SceneDataTest::parentsIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::parentsInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::parentsInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::parentsInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::parentsInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::parentsInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -5215,7 +5215,7 @@ void SceneDataTest::transformations2DIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::transformations2DInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::transformations2DInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::transformations2DInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::transformations2DInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::transformations2DInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -5259,7 +5259,7 @@ void SceneDataTest::transformations2DIntoArrayInvalidSizeOrOffsetTRS() { "Trade::SceneData::translationsRotationsScalings2DInto(): expected translation destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::translationsRotationsScalings2DInto(): expected rotation destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::translationsRotationsScalings2DInto(): expected scaling destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::translationsRotationsScalings2DInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::translationsRotationsScalings2DInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::translationsRotationsScalings2DInto(): mapping and translation destination views have different size, 3 vs 2\n" "Trade::SceneData::translationsRotationsScalings2DInto(): mapping and rotation destination views have different size, 3 vs 2\n" "Trade::SceneData::translationsRotationsScalings2DInto(): mapping and scaling destination views have different size, 3 vs 2\n" @@ -5811,7 +5811,7 @@ void SceneDataTest::transformations3DIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::transformations3DInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::transformations3DInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::transformations3DInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::transformations3DInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::transformations3DInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -5855,7 +5855,7 @@ void SceneDataTest::transformations3DIntoArrayInvalidSizeOrOffsetTRS() { "Trade::SceneData::translationsRotationsScalings3DInto(): expected translation destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::translationsRotationsScalings3DInto(): expected rotation destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::translationsRotationsScalings3DInto(): expected scaling destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::translationsRotationsScalings3DInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::translationsRotationsScalings3DInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::translationsRotationsScalings3DInto(): mapping and translation destination views have different size, 3 vs 2\n" "Trade::SceneData::translationsRotationsScalings3DInto(): mapping and rotation destination views have different size, 3 vs 2\n" "Trade::SceneData::translationsRotationsScalings3DInto(): mapping and scaling destination views have different size, 3 vs 2\n" @@ -6024,7 +6024,7 @@ void SceneDataTest::meshesMaterialsIntoArrayInvalidSizeOrOffset() { "Trade::SceneData::meshesMaterialsInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::meshesMaterialsInto(): expected mesh destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::meshesMaterialsInto(): expected mesh material destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::meshesMaterialsInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::meshesMaterialsInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::meshesMaterialsInto(): mapping and mesh destination views have different size, 3 vs 2\n" "Trade::SceneData::meshesMaterialsInto(): mapping and mesh material destination views have different size, 3 vs 2\n" "Trade::SceneData::meshesMaterialsInto(): mesh and mesh material destination views have different size, 3 vs 2\n"); @@ -6145,7 +6145,7 @@ void SceneDataTest::lightsIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::lightsInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::lightsInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::lightsInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::lightsInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::lightsInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -6264,7 +6264,7 @@ void SceneDataTest::camerasIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::camerasInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::camerasInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::camerasInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::camerasInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::camerasInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -6390,7 +6390,7 @@ void SceneDataTest::skinsIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::skinsInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::skinsInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::skinsInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::skinsInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::skinsInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -6513,7 +6513,7 @@ void SceneDataTest::importerStateIntoArrayInvalidSizeOrOffset() { CORRADE_COMPARE(out.str(), "Trade::SceneData::importerStateInto(): expected mapping destination view either empty or with 3 elements but got 2\n" "Trade::SceneData::importerStateInto(): expected field destination view either empty or with 3 elements but got 2\n" - "Trade::SceneData::importerStateInto(): offset 4 out of bounds for a field of size 3\n" + "Trade::SceneData::importerStateInto(): offset 4 out of range for a field of size 3\n" "Trade::SceneData::importerStateInto(): mapping and field destination views have different size, 3 vs 2\n"); } @@ -7610,23 +7610,23 @@ void SceneDataTest::findFieldObjectOffsetInvalidObject() { scene.camerasFor(7); scene.skinsFor(7); CORRADE_COMPARE(out.str(), - "Trade::SceneData::findFieldObjectOffset(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::findFieldObjectOffset(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::fieldObjectOffset(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::fieldObjectOffset(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::hasFieldObject(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::hasFieldObject(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::parentFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::childrenFor(): object -2 out of bounds for 7 objects\n" - "Trade::SceneData::childrenFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::transformation2DFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::translationRotationScaling2DFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::transformation3DFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::translationRotationScaling3DFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::meshesMaterialsFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::lightsFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::camerasFor(): object 7 out of bounds for 7 objects\n" - "Trade::SceneData::skinsFor(): object 7 out of bounds for 7 objects\n"); + "Trade::SceneData::findFieldObjectOffset(): object 7 out of range for 7 objects\n" + "Trade::SceneData::findFieldObjectOffset(): object 7 out of range for 7 objects\n" + "Trade::SceneData::fieldObjectOffset(): object 7 out of range for 7 objects\n" + "Trade::SceneData::fieldObjectOffset(): object 7 out of range for 7 objects\n" + "Trade::SceneData::hasFieldObject(): object 7 out of range for 7 objects\n" + "Trade::SceneData::hasFieldObject(): object 7 out of range for 7 objects\n" + "Trade::SceneData::parentFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::childrenFor(): object -2 out of range for 7 objects\n" + "Trade::SceneData::childrenFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::transformation2DFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::translationRotationScaling2DFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::transformation3DFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::translationRotationScaling3DFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::meshesMaterialsFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::lightsFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::camerasFor(): object 7 out of range for 7 objects\n" + "Trade::SceneData::skinsFor(): object 7 out of range for 7 objects\n"); } void SceneDataTest::releaseFieldData() { diff --git a/src/Magnum/Vk/DeviceProperties.cpp b/src/Magnum/Vk/DeviceProperties.cpp index 8f6c84da7..5783762d0 100644 --- a/src/Magnum/Vk/DeviceProperties.cpp +++ b/src/Magnum/Vk/DeviceProperties.cpp @@ -615,7 +615,7 @@ Containers::Optional tryPickDevice(Instance& instance) { Containers::Array devices{NoInit, id + 1}; const UnsignedInt count = Implementation::enumerateDevicesInto(instance, devices); if(id >= count) { - Error{} << "Vk::tryPickDevice(): index" << id << "out of bounds for" << count << "Vulkan devices"; + Error{} << "Vk::tryPickDevice(): index" << id << "out of range for" << count << "Vulkan devices"; return {}; } diff --git a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp index 502f51cbd..39b36c889 100644 --- a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp @@ -102,8 +102,8 @@ const struct { } PickDeviceErrorData[] { {"nothing for type found", Containers::array({"", "--magnum-device", "virtual"}), "Vk::tryPickDevice(): no Vk::DeviceType::VirtualGpu found among {} Vulkan devices\n"}, - {"index out of bounds", Containers::array({"", "--magnum-device", "666"}), - "Vk::tryPickDevice(): index 666 out of bounds for {} Vulkan devices\n"}, + {"index out of range", Containers::array({"", "--magnum-device", "666"}), + "Vk::tryPickDevice(): index 666 out of range for {} Vulkan devices\n"}, {"unknown type", Containers::array({"", "--magnum-device", "FAST"}), "Vk::tryPickDevice(): unknown Vulkan device type FAST\n"} }; diff --git a/src/Magnum/Vk/Test/ExtensionsTest.cpp b/src/Magnum/Vk/Test/ExtensionsTest.cpp index e36297841..4487813ae 100644 --- a/src/Magnum/Vk/Test/ExtensionsTest.cpp +++ b/src/Magnum/Vk/Test/ExtensionsTest.cpp @@ -94,7 +94,7 @@ void ExtensionsTest::isExtension() { { /* Not really a problem right now, but once people hit this we might want to guard against this (especially because the Index might be - out of bounds) */ + out of range) */ struct GLExtension { enum: std::size_t { Index }; }; diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index 7d85f8452..894c42e20 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -158,7 +158,7 @@ const struct { 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0, 19, 0, 0, 0, 0, 0, 0, 0, 'T', 'R', 'U', 'E', 'V', 'I', 'S', 'I', 'O', 'N', '-', 'X', 'F', 'I', 'L', 'E', '.', '\0' - }}, "TGA 2 extension offset 19 out of bounds for 44 bytes and a 26-byte file footer"}, + }}, "TGA 2 extension offset 19 out of range for 44 bytes and a 26-byte file footer"}, {"TGA 2 developer area offset overlaps with file header", {InPlaceInit, { 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0, 0, 0, 0, 0, 17, 0, 0, 0, @@ -168,7 +168,7 @@ const struct { 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0, 0, 0, 0, 0, 19, 0, 0, 0, 'T', 'R', 'U', 'E', 'V', 'I', 'S', 'I', 'O', 'N', '-', 'X', 'F', 'I', 'L', 'E', '.', '\0' - }}, "TGA 2 developer area offset 19 out of bounds for 44 bytes and a 26-byte file footer"}, + }}, "TGA 2 developer area offset 19 out of range for 44 bytes and a 26-byte file footer"}, {"TGA 2 developer area offset overlaps with extension area", {InPlaceInit, { 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0, '\xdd', '\xee', '\xee', diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index c06b39723..b9618467c 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -154,7 +154,7 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn return {}; } if(extensionOffset > _in.size() - sizeof(Implementation::TgaFooter)) { - Error{} << "Trade::TgaImporter::image2D(): TGA 2 extension offset" << extensionOffset << "out of bounds for" << _in.size() << "bytes and a" << sizeof(Implementation::TgaFooter) << Debug::nospace << "-byte file footer"; + Error{} << "Trade::TgaImporter::image2D(): TGA 2 extension offset" << extensionOffset << "out of range for" << _in.size() << "bytes and a" << sizeof(Implementation::TgaFooter) << Debug::nospace << "-byte file footer"; return {}; } @@ -168,7 +168,7 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn return {}; } if(developerAreaOffset > _in.size() - sizeof(Implementation::TgaFooter)) { - Error{} << "Trade::TgaImporter::image2D(): TGA 2 developer area offset" << developerAreaOffset << "out of bounds for" << _in.size() << "bytes and a" << sizeof(Implementation::TgaFooter) << Debug::nospace << "-byte file footer"; + Error{} << "Trade::TgaImporter::image2D(): TGA 2 developer area offset" << developerAreaOffset << "out of range for" << _in.size() << "bytes and a" << sizeof(Implementation::TgaFooter) << Debug::nospace << "-byte file footer"; return {}; }