Browse Source

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".
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
bab1559852
  1. 2
      src/Magnum/Animation/Test/InterpolationTest.cpp
  2. 2
      src/Magnum/DebugTools/FrameProfiler.cpp
  3. 14
      src/Magnum/DebugTools/Test/FrameProfilerTest.cpp
  4. 2
      src/Magnum/GL/Test/ContextTest.cpp
  5. 2
      src/Magnum/MeshTools/Concatenate.h
  6. 2
      src/Magnum/MeshTools/Duplicate.cpp
  7. 2
      src/Magnum/MeshTools/GenerateIndices.cpp
  8. 2
      src/Magnum/MeshTools/GenerateNormals.cpp
  9. 8
      src/Magnum/MeshTools/Test/DuplicateTest.cpp
  10. 12
      src/Magnum/MeshTools/Test/FilterTest.cpp
  11. 8
      src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp
  12. 8
      src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp
  13. 2
      src/Magnum/SceneTools/Test/SceneConverterTest.cpp
  14. 4
      src/Magnum/Shaders/DistanceFieldVectorGL.cpp
  15. 6
      src/Magnum/Shaders/FlatGL.cpp
  16. 4
      src/Magnum/Shaders/LineGL.cpp
  17. 8
      src/Magnum/Shaders/MeshVisualizerGL.cpp
  18. 14
      src/Magnum/Shaders/PhongGL.cpp
  19. 2
      src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp
  20. 4
      src/Magnum/Shaders/Test/FlatGLTest.cpp
  21. 2
      src/Magnum/Shaders/Test/LineGLTest.cpp
  22. 8
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  23. 10
      src/Magnum/Shaders/Test/PhongGLTest.cpp
  24. 2
      src/Magnum/Shaders/Test/VectorGLTest.cpp
  25. 2
      src/Magnum/Shaders/Test/VertexColorGLTest.cpp
  26. 4
      src/Magnum/Shaders/VectorGL.cpp
  27. 4
      src/Magnum/Shaders/VertexColorGL.cpp
  28. 2
      src/Magnum/Text/AbstractGlyphCache.cpp
  29. 2
      src/Magnum/Text/DistanceFieldGlyphCache.cpp
  30. 14
      src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp
  31. 6
      src/Magnum/Text/Test/AbstractLayouterTest.cpp
  32. 14
      src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp
  33. 4
      src/Magnum/Trade/AbstractImporter.h
  34. 64
      src/Magnum/Trade/SceneData.cpp
  35. 36
      src/Magnum/Trade/Test/MaterialDataTest.cpp
  36. 70
      src/Magnum/Trade/Test/SceneDataTest.cpp
  37. 2
      src/Magnum/Vk/DeviceProperties.cpp
  38. 4
      src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp
  39. 2
      src/Magnum/Vk/Test/ExtensionsTest.cpp
  40. 4
      src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp
  41. 4
      src/MagnumPlugins/TgaImporter/TgaImporter.cpp

2
src/Magnum/Animation/Test/InterpolationTest.cpp

@ -155,7 +155,7 @@ const struct {
{"before", 1}, {"before", 1},
{"at", 2}, {"at", 2},
{"after", 3}, {"after", 3},
{"out of bounds", 405780454} {"out of range", 405780454}
}; };
InterpolationTest::InterpolationTest() { InterpolationTest::InterpolationTest() {

2
src/Magnum/DebugTools/FrameProfiler.cpp

@ -264,7 +264,7 @@ UnsignedLong FrameProfiler::measurementData(const UnsignedInt id, const Unsigned
CORRADE_ASSERT(id < _measurements.size(), CORRADE_ASSERT(id < _measurements.size(),
"DebugTools::FrameProfiler::measurementData(): index" << id << "out of range for" << _measurements.size() << "measurements", {}); "DebugTools::FrameProfiler::measurementData(): index" << id << "out of range for" << _measurements.size() << "measurements", {});
CORRADE_ASSERT(frame < _maxFrameCount, 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), 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)", {}); "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)", {});

14
src/Magnum/DebugTools/Test/FrameProfilerTest.cpp

@ -54,8 +54,8 @@ struct FrameProfilerTest: TestSuite::Tester {
void delayZero(); void delayZero();
void delayTooLittleFrames(); void delayTooLittleFrames();
void startStopFrameUnexpected(); void startStopFrameUnexpected();
void measurementOutOfBounds(); void measurementOutOfRange();
void frameOutOfBounds(); void frameOutOfRange();
void dataNotAvailableYet(); void dataNotAvailableYet();
void meanNotAvailableYet(); void meanNotAvailableYet();
@ -128,8 +128,8 @@ FrameProfilerTest::FrameProfilerTest() {
&FrameProfilerTest::delayZero, &FrameProfilerTest::delayZero,
&FrameProfilerTest::delayTooLittleFrames, &FrameProfilerTest::delayTooLittleFrames,
&FrameProfilerTest::startStopFrameUnexpected, &FrameProfilerTest::startStopFrameUnexpected,
&FrameProfilerTest::measurementOutOfBounds, &FrameProfilerTest::measurementOutOfRange,
&FrameProfilerTest::frameOutOfBounds, &FrameProfilerTest::frameOutOfRange,
&FrameProfilerTest::dataNotAvailableYet, &FrameProfilerTest::dataNotAvailableYet,
&FrameProfilerTest::meanNotAvailableYet, &FrameProfilerTest::meanNotAvailableYet,
@ -828,7 +828,7 @@ void FrameProfilerTest::startStopFrameUnexpected() {
"DebugTools::FrameProfiler::beginFrame(): expected end of frame\n"); "DebugTools::FrameProfiler::beginFrame(): expected end of frame\n");
} }
void FrameProfilerTest::measurementOutOfBounds() { void FrameProfilerTest::measurementOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
FrameProfiler profiler{{ FrameProfiler profiler{{
@ -853,7 +853,7 @@ void FrameProfilerTest::measurementOutOfBounds() {
"DebugTools::FrameProfiler::measurementMean(): index 2 out of range for 2 measurements\n"); "DebugTools::FrameProfiler::measurementMean(): index 2 out of range for 2 measurements\n");
} }
void FrameProfilerTest::frameOutOfBounds() { void FrameProfilerTest::frameOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
FrameProfiler profiler{{ FrameProfiler profiler{{
@ -873,7 +873,7 @@ void FrameProfilerTest::frameOutOfBounds() {
Error redirectError{&out}; Error redirectError{&out};
profiler.measurementData(0, 3); profiler.measurementData(0, 3);
CORRADE_COMPARE(out.str(), 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() { void FrameProfilerTest::dataNotAvailableYet() {

2
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 /* Not really a problem right now, but once people hit this we might
want to guard against this (especially because the Index might be want to guard against this (especially because the Index might be
out of bounds) */ out of range) */
struct ALExtension { struct ALExtension {
enum: std::size_t { Index }; enum: std::size_t { Index };
}; };

2
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 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 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 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::LineStrip, @ref MeshPrimitive::LineLoop,
@ref MeshPrimitive::TriangleStrip and @ref MeshPrimitive::TriangleFan can't be @ref MeshPrimitive::TriangleStrip and @ref MeshPrimitive::TriangleFan can't be
concatenated --- use @ref generateIndices() to turn them into concatenated --- use @ref generateIndices() to turn them into

2
src/Magnum/MeshTools/Duplicate.cpp

@ -48,7 +48,7 @@ template<class T> inline void duplicateIntoImplementation(const Containers::Stri
const std::size_t size = data.size()[1]; const std::size_t size = data.size()[1];
for(std::size_t i = 0; i != indices.size(); ++i) { for(std::size_t i = 0; i != indices.size(); ++i) {
const std::size_t index = indices[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); std::memcpy(out[i].data(), data[index].data(), size);
} }
} }

2
src/Magnum/MeshTools/GenerateIndices.cpp

@ -489,7 +489,7 @@ template<class T> inline void generateQuadIndicesIntoImplementation(const Contai
auto get = [&](UnsignedInt j) -> const Vector3& { auto get = [&](UnsignedInt j) -> const Vector3& {
UnsignedInt index = quads[4*i + j]; UnsignedInt index = quads[4*i + j];
CORRADE_ASSERT(index < positions.size(), 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]; return positions[index];
}; };
const Vector3& a = get(0); const Vector3& a = get(0);

2
src/Magnum/MeshTools/GenerateNormals.cpp

@ -114,7 +114,7 @@ template<class T> inline void generateSmoothNormalsIntoImplementation(const Cont
Containers::arrayCast<UnsignedInt>(normals); Containers::arrayCast<UnsignedInt>(normals);
for(UnsignedInt& i: triangleCount) i = 0; for(UnsignedInt& i: triangleCount) i = 0;
for(const T index: indices) { 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]; ++triangleCount[index];
} }

8
src/Magnum/MeshTools/Test/DuplicateTest.cpp

@ -41,7 +41,7 @@ struct DuplicateTest: TestSuite::Tester {
explicit DuplicateTest(); explicit DuplicateTest();
void duplicate(); void duplicate();
void duplicateOutOfBounds(); void duplicateOutOfRange();
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
void duplicateStl(); void duplicateStl();
#endif #endif
@ -71,7 +71,7 @@ struct DuplicateTest: TestSuite::Tester {
DuplicateTest::DuplicateTest() { DuplicateTest::DuplicateTest() {
addTests({&DuplicateTest::duplicate, addTests({&DuplicateTest::duplicate,
&DuplicateTest::duplicateOutOfBounds, &DuplicateTest::duplicateOutOfRange,
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
&DuplicateTest::duplicateStl, &DuplicateTest::duplicateStl,
#endif #endif
@ -114,7 +114,7 @@ void DuplicateTest::duplicate() {
TestSuite::Compare::Container); TestSuite::Compare::Container);
} }
void DuplicateTest::duplicateOutOfBounds() { void DuplicateTest::duplicateOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
constexpr UnsignedByte indices[]{1, 1, 0, 4, 2, 2}; constexpr UnsignedByte indices[]{1, 1, 0, 4, 2, 2};
@ -125,7 +125,7 @@ void DuplicateTest::duplicateOutOfBounds() {
MeshTools::duplicate<UnsignedByte, Int>(indices, data); MeshTools::duplicate<UnsignedByte, Int>(indices, data);
CORRADE_COMPARE(out.str(), 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 #ifdef MAGNUM_BUILD_DEPRECATED

12
src/Magnum/MeshTools/Test/FilterTest.cpp

@ -53,7 +53,7 @@ struct FilterTest: TestSuite::Tester {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
void onlyAttributeIds(); void onlyAttributeIds();
void onlyAttributeIdsOutOfBounds(); void onlyAttributeIdsOutOfRange();
void onlyAttributeIdsNoIndexData(); void onlyAttributeIdsNoIndexData();
void onlyAttributeIdsNoAttributeData(); void onlyAttributeIdsNoAttributeData();
#endif #endif
@ -64,7 +64,7 @@ struct FilterTest: TestSuite::Tester {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
void exceptAttributeIds(); void exceptAttributeIds();
void exceptAttributeIdsOutOfBounds(); void exceptAttributeIdsOutOfRange();
void exceptAttributeIdsNoIndexData(); void exceptAttributeIdsNoIndexData();
void exceptAttributeIdsNoAttributeData(); void exceptAttributeIdsNoAttributeData();
#endif #endif
@ -95,7 +95,7 @@ FilterTest::FilterTest() {
addInstancedTests({&FilterTest::onlyAttributeIds}, addInstancedTests({&FilterTest::onlyAttributeIds},
Containers::arraySize(ImplementationSpecificIndexTypeData)); Containers::arraySize(ImplementationSpecificIndexTypeData));
addTests({&FilterTest::onlyAttributeIdsOutOfBounds, addTests({&FilterTest::onlyAttributeIdsOutOfRange,
&FilterTest::onlyAttributeIdsNoIndexData, &FilterTest::onlyAttributeIdsNoIndexData,
&FilterTest::onlyAttributeIdsNoAttributeData}); &FilterTest::onlyAttributeIdsNoAttributeData});
#endif #endif
@ -110,7 +110,7 @@ FilterTest::FilterTest() {
addInstancedTests({&FilterTest::exceptAttributeIds}, addInstancedTests({&FilterTest::exceptAttributeIds},
Containers::arraySize(ImplementationSpecificIndexTypeData)); Containers::arraySize(ImplementationSpecificIndexTypeData));
addTests({&FilterTest::exceptAttributeIdsOutOfBounds, addTests({&FilterTest::exceptAttributeIdsOutOfRange,
&FilterTest::exceptAttributeIdsNoIndexData, &FilterTest::exceptAttributeIdsNoIndexData,
&FilterTest::exceptAttributeIdsNoAttributeData}); &FilterTest::exceptAttributeIdsNoAttributeData});
#endif #endif
@ -383,7 +383,7 @@ void FilterTest::onlyAttributeIds() {
CORRADE_VERIFY(!attributeData.deleter()); CORRADE_VERIFY(!attributeData.deleter());
} }
void FilterTest::onlyAttributeIdsOutOfBounds() { void FilterTest::onlyAttributeIdsOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* GCC 4.8 dies if I try to initialize this with a {}. I won't, then. */ /* 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()); CORRADE_VERIFY(!attributeData.deleter());
} }
void FilterTest::exceptAttributeIdsOutOfBounds() { void FilterTest::exceptAttributeIdsOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
/* GCC 4.8 dies if I try to initialize this with a {}. I won't, then. */ /* GCC 4.8 dies if I try to initialize this with a {}. I won't, then. */

8
src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp

@ -76,7 +76,7 @@ struct GenerateIndicesTest: TestSuite::Tester {
template<class T> void generateQuadIndices(); template<class T> void generateQuadIndices();
template<class T> void generateQuadIndicesInto(); template<class T> void generateQuadIndicesInto();
void generateQuadIndicesWrongIndexCount(); void generateQuadIndicesWrongIndexCount();
void generateQuadIndicesIndexOutOfBounds(); void generateQuadIndicesIndexOutOfRange();
void generateQuadIndicesIntoWrongSize(); void generateQuadIndicesIntoWrongSize();
void generateIndicesMeshData(); void generateIndicesMeshData();
@ -266,7 +266,7 @@ GenerateIndicesTest::GenerateIndicesTest() {
&GenerateIndicesTest::generateQuadIndicesInto<UnsignedShort>, &GenerateIndicesTest::generateQuadIndicesInto<UnsignedShort>,
&GenerateIndicesTest::generateQuadIndicesInto<UnsignedByte>, &GenerateIndicesTest::generateQuadIndicesInto<UnsignedByte>,
&GenerateIndicesTest::generateQuadIndicesWrongIndexCount, &GenerateIndicesTest::generateQuadIndicesWrongIndexCount,
&GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds, &GenerateIndicesTest::generateQuadIndicesIndexOutOfRange,
&GenerateIndicesTest::generateQuadIndicesIntoWrongSize}); &GenerateIndicesTest::generateQuadIndicesIntoWrongSize});
addInstancedTests({&GenerateIndicesTest::generateIndicesMeshData, addInstancedTests({&GenerateIndicesTest::generateIndicesMeshData,
@ -1031,7 +1031,7 @@ void GenerateIndicesTest::generateQuadIndicesWrongIndexCount() {
"MeshTools::generateQuadIndicesInto(): quad index count 13 not divisible by 4\n"); "MeshTools::generateQuadIndicesInto(): quad index count 13 not divisible by 4\n");
} }
void GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds() { void GenerateIndicesTest::generateQuadIndicesIndexOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
UnsignedInt quads[]{5, 4, 6, 7}; UnsignedInt quads[]{5, 4, 6, 7};
@ -1041,7 +1041,7 @@ void GenerateIndicesTest::generateQuadIndicesIndexOutOfBounds() {
Error redirectError{&out}; Error redirectError{&out};
MeshTools::generateQuadIndices(positions, quads); MeshTools::generateQuadIndices(positions, quads);
CORRADE_COMPARE(out.str(), 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() { void GenerateIndicesTest::generateQuadIndicesIntoWrongSize() {

8
src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp

@ -61,7 +61,7 @@ struct GenerateNormalsTest: TestSuite::Tester {
void smoothZeroAreaTriangle(); void smoothZeroAreaTriangle();
void smoothNanPosition(); void smoothNanPosition();
void smoothWrongCount(); void smoothWrongCount();
void smoothOutOfBounds(); void smoothOutOfRange();
void smoothIntoWrongSize(); void smoothIntoWrongSize();
template<class T> void smoothErased(); template<class T> void smoothErased();
@ -89,7 +89,7 @@ GenerateNormalsTest::GenerateNormalsTest() {
&GenerateNormalsTest::smoothZeroAreaTriangle, &GenerateNormalsTest::smoothZeroAreaTriangle,
&GenerateNormalsTest::smoothNanPosition, &GenerateNormalsTest::smoothNanPosition,
&GenerateNormalsTest::smoothWrongCount, &GenerateNormalsTest::smoothWrongCount,
&GenerateNormalsTest::smoothOutOfBounds, &GenerateNormalsTest::smoothOutOfRange,
&GenerateNormalsTest::smoothIntoWrongSize, &GenerateNormalsTest::smoothIntoWrongSize,
&GenerateNormalsTest::smoothErased<UnsignedByte>, &GenerateNormalsTest::smoothErased<UnsignedByte>,
@ -402,7 +402,7 @@ void GenerateNormalsTest::smoothWrongCount() {
CORRADE_COMPARE(out.str(), "MeshTools::generateSmoothNormalsInto(): index count not divisible by 3\n"); CORRADE_COMPARE(out.str(), "MeshTools::generateSmoothNormalsInto(): index count not divisible by 3\n");
} }
void GenerateNormalsTest::smoothOutOfBounds() { void GenerateNormalsTest::smoothOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
std::stringstream out; std::stringstream out;
@ -411,7 +411,7 @@ void GenerateNormalsTest::smoothOutOfBounds() {
const Vector3 positions[2]; const Vector3 positions[2];
const UnsignedInt indices[] { 0, 1, 2 }; const UnsignedInt indices[] { 0, 1, 2 };
generateSmoothNormals(indices, positions); 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() { void GenerateNormalsTest::smoothIntoWrongSize() {

2
src/Magnum/SceneTools/Test/SceneConverterTest.cpp

@ -1308,7 +1308,7 @@ const struct {
nullptr, nullptr,
"Trade::AbstractSceneConverter::addSupportedImporterContents(): ignoring 1 3D images not supported by the converter\n" "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 /* 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" "Trade::GltfSceneConverter::add(): 2D array textures require experimentalKhrTextureKtx to be enabled\n"
"Cannot add material dependencies\n"}, "Cannot add material dependencies\n"},
{"can't add processed material", {InPlaceInit, { {"can't add processed material", {InPlaceInit, {

4
src/Magnum/Shaders/DistanceFieldVectorGL.cpp

@ -385,10 +385,10 @@ template<UnsignedInt dimensions> DistanceFieldVectorGL<dimensions>& DistanceFiel
"Shaders::DistanceFieldVectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); "Shaders::DistanceFieldVectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

6
src/Magnum/Shaders/FlatGL.cpp

@ -614,7 +614,7 @@ template<UnsignedInt dimensions> FlatGL<dimensions>& FlatGL<dimensions>::setJoin
CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers),
"Shaders::FlatGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this); "Shaders::FlatGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this);
CORRADE_ASSERT(id < _jointCount, 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); setUniform(_jointMatricesUniform + id, matrix);
return *this; return *this;
} }
@ -633,10 +633,10 @@ template<UnsignedInt dimensions> FlatGL<dimensions>& FlatGL<dimensions>::setDraw
"Shaders::FlatGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); "Shaders::FlatGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

4
src/Magnum/Shaders/LineGL.cpp

@ -398,10 +398,10 @@ template<UnsignedInt dimensions> LineGL<dimensions>& LineGL<dimensions>::setDraw
"Shaders::LineGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); "Shaders::LineGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

8
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); "Shaders::MeshVisualizerGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= FlagBase::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
@ -1002,7 +1002,7 @@ MeshVisualizerGL2D& MeshVisualizerGL2D::setJointMatrix(const UnsignedInt id, con
CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers), CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers),
"Shaders::MeshVisualizerGL2D::setJointMatrix(): the shader was created with uniform buffers enabled", *this); "Shaders::MeshVisualizerGL2D::setJointMatrix(): the shader was created with uniform buffers enabled", *this);
CORRADE_ASSERT(id < _jointCount, 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); setUniform(_jointMatricesUniform + id, matrix);
return *this; return *this;
} }
@ -1654,7 +1654,7 @@ MeshVisualizerGL3D& MeshVisualizerGL3D::setJointMatrix(const UnsignedInt id, con
CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers), CORRADE_ASSERT(!(flags() >= Flag::UniformBuffers),
"Shaders::MeshVisualizerGL3D::setJointMatrix(): the shader was created with uniform buffers enabled", *this); "Shaders::MeshVisualizerGL3D::setJointMatrix(): the shader was created with uniform buffers enabled", *this);
CORRADE_ASSERT(id < _jointCount, 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); setUniform(_jointMatricesUniform + id, matrix);
return *this; return *this;
} }

14
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); "Shaders::PhongGL::setLightPosition(): the shader was created with uniform buffers enabled", *this);
#endif #endif
CORRADE_ASSERT(id < _lightCount, 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); setUniform(_lightPositionsUniform + id, position);
return *this; 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); "Shaders::PhongGL::setLightColor(): the shader was created with uniform buffers enabled", *this);
#endif #endif
CORRADE_ASSERT(id < _lightCount, 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); setUniform(_lightColorsUniform + id, color);
return *this; 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); "Shaders::PhongGL::setLightSpecularColor(): the shader was created with uniform buffers enabled", *this);
#endif #endif
CORRADE_ASSERT(id < _lightCount, 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), CORRADE_ASSERT(!(_flags >= Flag::NoSpecular),
"Shaders::PhongGL::setLightSpecularColor(): the shader was created with specular disabled", *this); "Shaders::PhongGL::setLightSpecularColor(): the shader was created with specular disabled", *this);
setUniform(_lightSpecularColorsUniform + id, color); 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); "Shaders::PhongGL::setLightRange(): the shader was created with uniform buffers enabled", *this);
#endif #endif
CORRADE_ASSERT(id < _lightCount, 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); setUniform(_lightRangesUniform + id, range);
return *this; return *this;
} }
@ -983,7 +983,7 @@ PhongGL& PhongGL::setJointMatrix(const UnsignedInt id, const Matrix4& matrix) {
CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers),
"Shaders::PhongGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this); "Shaders::PhongGL::setJointMatrix(): the shader was created with uniform buffers enabled", *this);
CORRADE_ASSERT(id < _jointCount, 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); setUniform(_jointMatricesUniform + id, matrix);
return *this; 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); "Shaders::PhongGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

2
src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp

@ -743,7 +743,7 @@ template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::setWrongDrawOff
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

4
src/Magnum/Shaders/Test/FlatGLTest.cpp

@ -1747,7 +1747,7 @@ template<UnsignedInt dimensions> void FlatGLTest::setWrongJointCountOrId() {
.setJointMatrix(5, MatrixTypeFor<dimensions, Float>{}); .setJointMatrix(5, MatrixTypeFor<dimensions, Float>{});
CORRADE_COMPARE(out.str(), CORRADE_COMPARE(out.str(),
"Shaders::FlatGL::setJointMatrices(): expected at most 5 items but got 6\n" "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 #endif
@ -1771,7 +1771,7 @@ template<UnsignedInt dimensions> void FlatGLTest::setWrongDrawOffset() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

2
src/Magnum/Shaders/Test/LineGLTest.cpp

@ -966,7 +966,7 @@ template<UnsignedInt dimensions> void LineGLTest::setWrongDrawOffset() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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}; constexpr Vector2i RenderSizeLarge{128, 128};

8
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -3078,7 +3078,7 @@ void MeshVisualizerGLTest::setWrongJointCountOrId2D() {
.setJointMatrix(5, Matrix3{}); .setJointMatrix(5, Matrix3{});
CORRADE_COMPARE(out.str(), CORRADE_COMPARE(out.str(),
"Shaders::MeshVisualizerGL2D::setJointMatrices(): expected at most 5 items but got 6\n" "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() { void MeshVisualizerGLTest::setWrongJointCountOrId3D() {
@ -3103,7 +3103,7 @@ void MeshVisualizerGLTest::setWrongJointCountOrId3D() {
.setJointMatrix(5, Matrix4{}); .setJointMatrix(5, Matrix4{});
CORRADE_COMPARE(out.str(), CORRADE_COMPARE(out.str(),
"Shaders::MeshVisualizerGL3D::setJointMatrices(): expected at most 5 items but got 6\n" "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 #endif
@ -3125,7 +3125,7 @@ void MeshVisualizerGLTest::setWrongDrawOffset2D() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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() { void MeshVisualizerGLTest::setWrongDrawOffset3D() {
@ -3145,7 +3145,7 @@ void MeshVisualizerGLTest::setWrongDrawOffset3D() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

10
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::setLightColors(): expected 5 items but got 1\n"
"Shaders::PhongGL::setLightPositions(): 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::setLightRanges(): expected 5 items but got 1\n"
"Shaders::PhongGL::setLightColor(): 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 bounds 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 bounds for 5 lights\n"); "Shaders::PhongGL::setLightRange(): light ID 5 is out of range for 5 lights\n");
} }
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -2209,7 +2209,7 @@ void PhongGLTest::setWrongJointCountOrId() {
.setJointMatrix(5, Matrix4{}); .setJointMatrix(5, Matrix4{});
CORRADE_COMPARE(out.str(), CORRADE_COMPARE(out.str(),
"Shaders::PhongGL::setJointMatrices(): expected at most 5 items but got 6\n" "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 #endif
@ -2232,7 +2232,7 @@ void PhongGLTest::setWrongDrawOffset() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

2
src/Magnum/Shaders/Test/VectorGLTest.cpp

@ -734,7 +734,7 @@ template<UnsignedInt dimensions> void VectorGLTest::setWrongDrawOffset() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

2
src/Magnum/Shaders/Test/VertexColorGLTest.cpp

@ -607,7 +607,7 @@ template<UnsignedInt dimensions> void VertexColorGLTest::setWrongDrawOffset() {
Error redirectError{&out}; Error redirectError{&out};
shader.setDrawOffset(5); shader.setDrawOffset(5);
CORRADE_COMPARE(out.str(), 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 #endif

4
src/Magnum/Shaders/VectorGL.cpp

@ -364,10 +364,10 @@ template<UnsignedInt dimensions> VectorGL<dimensions>& VectorGL<dimensions>::set
"Shaders::VectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); "Shaders::VectorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1 if(_drawCount > 1
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL

4
src/Magnum/Shaders/VertexColorGL.cpp

@ -286,10 +286,10 @@ template<UnsignedInt dimensions> VertexColorGL<dimensions>& VertexColorGL<dimens
"Shaders::VertexColorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this); "Shaders::VertexColorGL::setDrawOffset(): the shader was not created with uniform buffers enabled", *this);
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
CORRADE_ASSERT(_flags >= Flag::ShaderStorageBuffers || offset < _drawCount, CORRADE_ASSERT(_flags >= 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 #else
CORRADE_ASSERT(offset < _drawCount, 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 #endif
if(_drawCount > 1) setUniform(_drawOffsetUniform, offset); if(_drawCount > 1) setUniform(_drawOffsetUniform, offset);
return *this; return *this;

2
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) { void AbstractGlyphCache::setImage(const Vector2i& offset, const ImageView2D& image) {
CORRADE_ASSERT((offset >= Vector2i{} && offset + image.size() <= _size).all(), 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); doSetImage(offset, image);
} }

2
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) { void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, const ImageView2D& image) {
CORRADE_ASSERT((offset >= Vector2i{} && offset + image.size() <= _size).all(), 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 #ifndef CORRADE_NO_ASSERT
const GL::PixelFormat format = GL::pixelFormat(image.format()); const GL::PixelFormat format = GL::pixelFormat(image.format());

14
src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp

@ -45,7 +45,7 @@ struct AbstractGlyphCacheTest: TestSuite::Tester {
void reserve(); void reserve();
void setImage(); void setImage();
void setImageOutOfBounds(); void setImageOutOfRange();
void image(); void image();
void imageNotSupported(); void imageNotSupported();
@ -58,7 +58,7 @@ AbstractGlyphCacheTest::AbstractGlyphCacheTest() {
&AbstractGlyphCacheTest::reserve, &AbstractGlyphCacheTest::reserve,
&AbstractGlyphCacheTest::setImage, &AbstractGlyphCacheTest::setImage,
&AbstractGlyphCacheTest::setImageOutOfBounds, &AbstractGlyphCacheTest::setImageOutOfRange,
&AbstractGlyphCacheTest::image, &AbstractGlyphCacheTest::image,
&AbstractGlyphCacheTest::imageNotSupported, &AbstractGlyphCacheTest::imageNotSupported,
@ -135,7 +135,7 @@ void AbstractGlyphCacheTest::setImage() {
CORRADE_COMPARE(cache.imageSize, (Vector2i{20, 25})); CORRADE_COMPARE(cache.imageSize, (Vector2i{20, 25}));
} }
void AbstractGlyphCacheTest::setImageOutOfBounds() { void AbstractGlyphCacheTest::setImageOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
DummyGlyphCache cache{{100, 200}}; DummyGlyphCache cache{{100, 200}};
@ -150,10 +150,10 @@ void AbstractGlyphCacheTest::setImageOutOfBounds() {
cache.setImage({-1, 175}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); cache.setImage({-1, 175}, ImageView2D{PixelFormat::R8Unorm, {20, 25}});
cache.setImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); cache.setImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}});
CORRADE_COMPARE_AS(out.str(), 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({81, 175}, {101, 200}) out of range 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({80, 176}, {100, 201}) out of range 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({-1, 175}, {19, 200}) out of range 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({80, -1}, {100, 24}) out of range for texture size Vector(100, 200)\n",
TestSuite::Compare::String); TestSuite::Compare::String);
} }

6
src/Magnum/Text/Test/AbstractLayouterTest.cpp

@ -36,12 +36,12 @@ struct AbstractLayouterTest: TestSuite::Tester {
explicit AbstractLayouterTest(); explicit AbstractLayouterTest();
void renderGlyph(); void renderGlyph();
void renderGlyphOutOfBounds(); void renderGlyphOutOfRange();
}; };
AbstractLayouterTest::AbstractLayouterTest() { AbstractLayouterTest::AbstractLayouterTest() {
addTests({&AbstractLayouterTest::renderGlyph, addTests({&AbstractLayouterTest::renderGlyph,
&AbstractLayouterTest::renderGlyphOutOfBounds}); &AbstractLayouterTest::renderGlyphOutOfRange});
} }
void AbstractLayouterTest::renderGlyph() { void AbstractLayouterTest::renderGlyph() {
@ -82,7 +82,7 @@ void AbstractLayouterTest::renderGlyph() {
CORRADE_COMPARE(rectangle, Range2D({2.0f, 0.5f}, {6.1f, 3.0f})); CORRADE_COMPARE(rectangle, Range2D({2.0f, 0.5f}, {6.1f, 3.0f}));
} }
void AbstractLayouterTest::renderGlyphOutOfBounds() { void AbstractLayouterTest::renderGlyphOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
struct Layouter: AbstractLayouter { struct Layouter: AbstractLayouter {

14
src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp

@ -54,7 +54,7 @@ struct DistanceFieldGlyphCacheGLTest: GL::OpenGLTester {
void setImage(); void setImage();
void setDistanceFieldImage(); void setDistanceFieldImage();
void setDistanceFieldImageOutOfBounds(); void setDistanceFieldImageOutOfRange();
PluginManager::Manager<Trade::AbstractImporter> _manager{"nonexistent"}; PluginManager::Manager<Trade::AbstractImporter> _manager{"nonexistent"};
}; };
@ -79,7 +79,7 @@ DistanceFieldGlyphCacheGLTest::DistanceFieldGlyphCacheGLTest() {
Containers::arraySize(SetImageData)); Containers::arraySize(SetImageData));
addTests({&DistanceFieldGlyphCacheGLTest::setDistanceFieldImage, addTests({&DistanceFieldGlyphCacheGLTest::setDistanceFieldImage,
&DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfBounds}); &DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfRange});
/* Load the plugin directly from the build tree. Otherwise it's either /* Load the plugin directly from the build tree. Otherwise it's either
static and already loaded or not present in the build tree */ static and already loaded or not present in the build tree */
@ -197,7 +197,7 @@ void DistanceFieldGlyphCacheGLTest::setDistanceFieldImage() {
#endif #endif
} }
void DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfBounds() { void DistanceFieldGlyphCacheGLTest::setDistanceFieldImageOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
DistanceFieldGlyphCache cache{{200, 300}, {100, 200}, 4}; 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({-1, 175}, ImageView2D{PixelFormat::R8Unorm, {20, 25}});
cache.setDistanceFieldImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}}); cache.setDistanceFieldImage({80, -1}, ImageView2D{PixelFormat::R8Unorm, {20, 25}});
CORRADE_COMPARE_AS(out.str(), 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({81, 175}, {101, 200}) out of range 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({80, 176}, {100, 201}) out of range 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({-1, 175}, {19, 200}) out of range 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({80, -1}, {100, 24}) out of range for texture size Vector(100, 200)\n",
TestSuite::Compare::String); TestSuite::Compare::String);
} }

4
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 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, 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 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 calling functions without a file open, accessing an empty optional, ...) is
treated as a programmer error and will produce the usual assertions. 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 * Default implementation returns @cpp -1 @ce. This function isn't
* expected to fail --- if an import error occus (for example because * 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. * already during file opening.
*/ */
virtual Int doDefaultScene() const; virtual Int doDefaultScene() const;

64
src/Magnum/Trade/SceneData.cpp

@ -1229,13 +1229,13 @@ std::size_t SceneData::findFieldObjectOffsetInternal(const SceneFieldData& field
Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const { Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const {
CORRADE_ASSERT(object < _mappingBound, 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(), CORRADE_ASSERT(fieldId < _fields.size(),
"Trade::SceneData::findFieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); "Trade::SceneData::findFieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {});
const SceneFieldData& field = _fields[fieldId]; const SceneFieldData& field = _fields[fieldId];
CORRADE_ASSERT(offset <= field._size, 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); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset);
return found == field._size ? Containers::Optional<std::size_t>{} : found; return found == field._size ? Containers::Optional<std::size_t>{} : found;
@ -1243,7 +1243,7 @@ Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const Unsigne
Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const SceneField fieldName, const UnsignedLong object, const std::size_t offset) const { Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const SceneField fieldName, const UnsignedLong object, const std::size_t offset) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(fieldName);
CORRADE_ASSERT(fieldId != ~UnsignedInt{}, CORRADE_ASSERT(fieldId != ~UnsignedInt{},
@ -1251,7 +1251,7 @@ Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const SceneFi
const SceneFieldData& field = _fields[fieldId]; const SceneFieldData& field = _fields[fieldId];
CORRADE_ASSERT(offset <= field._size, 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); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset);
return found == field._size ? Containers::Optional<std::size_t>{} : found; return found == field._size ? Containers::Optional<std::size_t>{} : found;
@ -1259,13 +1259,13 @@ Containers::Optional<std::size_t> SceneData::findFieldObjectOffset(const SceneFi
std::size_t SceneData::fieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const { std::size_t SceneData::fieldObjectOffset(const UnsignedInt fieldId, const UnsignedLong object, const std::size_t offset) const {
CORRADE_ASSERT(object < _mappingBound, 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(), CORRADE_ASSERT(fieldId < _fields.size(),
"Trade::SceneData::fieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); "Trade::SceneData::fieldObjectOffset(): index" << fieldId << "out of range for" << _fields.size() << "fields", {});
const SceneFieldData& field = _fields[fieldId]; const SceneFieldData& field = _fields[fieldId];
CORRADE_ASSERT(offset <= field._size, 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); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset);
CORRADE_ASSERT(found != field._size, 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 { std::size_t SceneData::fieldObjectOffset(const SceneField fieldName, const UnsignedLong object, const std::size_t offset) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(fieldName);
CORRADE_ASSERT(fieldId != ~UnsignedInt{}, CORRADE_ASSERT(fieldId != ~UnsignedInt{},
@ -1283,7 +1283,7 @@ std::size_t SceneData::fieldObjectOffset(const SceneField fieldName, const Unsig
const SceneFieldData& field = _fields[fieldId]; const SceneFieldData& field = _fields[fieldId];
CORRADE_ASSERT(offset <= field._size, 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); const std::size_t found = findFieldObjectOffsetInternal(field, object, offset);
CORRADE_ASSERT(found != field._size, 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 { bool SceneData::hasFieldObject(const UnsignedInt fieldId, const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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(), CORRADE_ASSERT(fieldId < _fields.size(),
"Trade::SceneData::hasFieldObject(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); "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 { bool SceneData::hasFieldObject(const SceneField fieldName, const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(fieldName);
CORRADE_ASSERT(fieldId != ~UnsignedInt{}, 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(), CORRADE_ASSERT(fieldId < _fields.size(),
"Trade::SceneData::mappingInto(): index" << fieldId << "out of range for" << _fields.size() << "fields", {}); "Trade::SceneData::mappingInto(): index" << fieldId << "out of range for" << _fields.size() << "fields", {});
CORRADE_ASSERT(offset <= _fields[fieldId]._size, 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); const std::size_t size = Math::min(destination.size(), std::size_t(_fields[fieldId]._size) - offset);
mappingIntoInternal(fieldId, offset, destination.prefix(size)); mappingIntoInternal(fieldId, offset, destination.prefix(size));
return 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", {}); "Trade::SceneData::parentsInto(): field not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::parentsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::transformations2DInto(): no transformation-related field found", {});
const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::transformations2DInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::translationsRotationsScalings2DInto(): no transformation-related field found", {});
const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !translationDestination || mappingDestination.size() == translationDestination.size(),
"Trade::SceneData::translationsRotationsScalings2DInto(): mapping and translation destination views have different size," << mappingDestination.size() << "vs" << 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(), 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", {}); "Trade::SceneData::transformations3DInto(): no transformation-related field found", {});
const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::transformations3DInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::translationsRotationsScalings3DInto(): no transformation-related field found", {});
const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size; const std::size_t fieldSize = _fields[fieldWithObjectMapping]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !translationDestination || mappingDestination.size() == translationDestination.size(),
"Trade::SceneData::translationsRotationsScalings3DInto(): mapping and translation destination views have different size," << mappingDestination.size() << "vs" << 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(), 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", {}); "Trade::SceneData::meshesMaterialsInto(): field" << SceneField::Mesh << "not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !meshDestination || mappingDestination.size() == meshDestination.size(),
"Trade::SceneData::meshesMaterialsInto(): mapping and mesh destination views have different size," << mappingDestination.size() << "vs" << 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(), 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", {}); "Trade::SceneData::lightsInto(): field not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::lightsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::camerasInto(): field not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::camerasInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::skinsInto(): field not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::skinsInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); 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", {}); "Trade::SceneData::importerStateInto(): field not found", {});
const std::size_t fieldSize = _fields[fieldId]._size; const std::size_t fieldSize = _fields[fieldId]._size;
CORRADE_ASSERT(offset <= fieldSize, 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(), CORRADE_ASSERT(!mappingDestination != !fieldDestination|| mappingDestination.size() == fieldDestination.size(),
"Trade::SceneData::importerStateInto(): mapping and field destination views have different size," << mappingDestination.size() << "vs" << 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); const std::size_t size = Math::min(Math::max(mappingDestination.size(), fieldDestination.size()), fieldSize - offset);
@ -2636,7 +2636,7 @@ Containers::Array<Containers::Pair<UnsignedInt, const void*>> SceneData::importe
Containers::Optional<Long> SceneData::parentFor(const UnsignedLong object) const { Containers::Optional<Long> SceneData::parentFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Parent);
if(fieldId == ~UnsignedInt{}) return {}; if(fieldId == ~UnsignedInt{}) return {};
@ -2652,7 +2652,7 @@ Containers::Optional<Long> SceneData::parentFor(const UnsignedLong object) const
Containers::Array<UnsignedLong> SceneData::childrenFor(const Long object) const { Containers::Array<UnsignedLong> SceneData::childrenFor(const Long object) const {
CORRADE_ASSERT(object >= -1 && object < Long(_mappingBound), 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); const UnsignedInt parentFieldId = findFieldIdInternal(SceneField::Parent);
if(parentFieldId == ~UnsignedInt{}) return {}; if(parentFieldId == ~UnsignedInt{}) return {};
@ -2682,7 +2682,7 @@ Containers::Array<UnsignedLong> SceneData::childrenFor(const Long object) const
Containers::Optional<Matrix3> SceneData::transformation2DFor(const UnsignedLong object) const { Containers::Optional<Matrix3> SceneData::transformation2DFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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; UnsignedInt transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId;
const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId); const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId);
@ -2703,7 +2703,7 @@ Containers::Optional<Matrix3> SceneData::transformation2DFor(const UnsignedLong
Containers::Optional<Containers::Triple<Vector2, Complex, Vector2>> SceneData::translationRotationScaling2DFor(const UnsignedLong object) const { Containers::Optional<Containers::Triple<Vector2, Complex, Vector2>> SceneData::translationRotationScaling2DFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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; UnsignedInt translationFieldId, rotationFieldId, scalingFieldId;
const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId); const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId);
@ -2726,7 +2726,7 @@ Containers::Optional<Containers::Triple<Vector2, Complex, Vector2>> SceneData::t
Containers::Optional<Matrix4> SceneData::transformation3DFor(const UnsignedLong object) const { Containers::Optional<Matrix4> SceneData::transformation3DFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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; UnsignedInt transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId;
const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId); const UnsignedInt fieldWithObjectMapping = findTransformationFields(transformationFieldId, translationFieldId, rotationFieldId, scalingFieldId);
@ -2747,7 +2747,7 @@ Containers::Optional<Matrix4> SceneData::transformation3DFor(const UnsignedLong
Containers::Optional<Containers::Triple<Vector3, Quaternion, Vector3>> SceneData::translationRotationScaling3DFor(const UnsignedLong object) const { Containers::Optional<Containers::Triple<Vector3, Quaternion, Vector3>> SceneData::translationRotationScaling3DFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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; UnsignedInt translationFieldId, rotationFieldId, scalingFieldId;
const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId); const UnsignedInt fieldWithObjectMapping = findTranslationRotationScalingFields(translationFieldId, rotationFieldId, scalingFieldId);
@ -2770,7 +2770,7 @@ Containers::Optional<Containers::Triple<Vector3, Quaternion, Vector3>> SceneData
Containers::Array<Containers::Pair<UnsignedInt, Int>> SceneData::meshesMaterialsFor(const UnsignedLong object) const { Containers::Array<Containers::Pair<UnsignedInt, Int>> SceneData::meshesMaterialsFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt meshFieldId = findFieldIdInternal(SceneField::Mesh);
if(meshFieldId == ~UnsignedInt{}) return {}; if(meshFieldId == ~UnsignedInt{}) return {};
@ -2794,7 +2794,7 @@ Containers::Array<Containers::Pair<UnsignedInt, Int>> SceneData::meshesMaterials
Containers::Array<UnsignedInt> SceneData::lightsFor(const UnsignedLong object) const { Containers::Array<UnsignedInt> SceneData::lightsFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Light);
if(fieldId == ~UnsignedInt{}) return {}; if(fieldId == ~UnsignedInt{}) return {};
@ -2817,7 +2817,7 @@ Containers::Array<UnsignedInt> SceneData::lightsFor(const UnsignedLong object) c
Containers::Array<UnsignedInt> SceneData::camerasFor(const UnsignedLong object) const { Containers::Array<UnsignedInt> SceneData::camerasFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Camera);
if(fieldId == ~UnsignedInt{}) return {}; if(fieldId == ~UnsignedInt{}) return {};
@ -2840,7 +2840,7 @@ Containers::Array<UnsignedInt> SceneData::camerasFor(const UnsignedLong object)
Containers::Array<UnsignedInt> SceneData::skinsFor(const UnsignedLong object) const { Containers::Array<UnsignedInt> SceneData::skinsFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(SceneField::Skin);
if(fieldId == ~UnsignedInt{}) return {}; if(fieldId == ~UnsignedInt{}) return {};
@ -2863,7 +2863,7 @@ Containers::Array<UnsignedInt> SceneData::skinsFor(const UnsignedLong object) co
Containers::Optional<const void*> SceneData::importerStateFor(const UnsignedLong object) const { Containers::Optional<const void*> SceneData::importerStateFor(const UnsignedLong object) const {
CORRADE_ASSERT(object < _mappingBound, 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); const UnsignedInt fieldId = findFieldIdInternal(SceneField::ImporterState);
if(fieldId == ~UnsignedInt{}) return {}; if(fieldId == ~UnsignedInt{}) return {};

36
src/Magnum/Trade/Test/MaterialDataTest.cpp

@ -99,7 +99,7 @@ struct MaterialDataTest: TestSuite::Tester {
void constructLayers(); void constructLayers();
void constructLayersNotMonotonic(); void constructLayersNotMonotonic();
void constructLayersOffsetOutOfBounds(); void constructLayersOffsetOutOfRange();
void constructLayersLastOffsetTooShort(); void constructLayersLastOffsetTooShort();
void constructNonOwned(); void constructNonOwned();
@ -108,7 +108,7 @@ struct MaterialDataTest: TestSuite::Tester {
void constructNonOwnedNotSorted(); void constructNonOwnedNotSorted();
void constructNonOwnedDuplicateAttribute(); void constructNonOwnedDuplicateAttribute();
void constructNonOwnedLayersNotMonotonic(); void constructNonOwnedLayersNotMonotonic();
void constructNonOwnedLayersOffsetOutOfBounds(); void constructNonOwnedLayersOffsetOutOfRange();
void constructNonOwnedLayersLastOffsetTooShort(); void constructNonOwnedLayersLastOffsetTooShort();
void constructNonOwnedAttributeFlagOwned(); void constructNonOwnedAttributeFlagOwned();
void constructNonOwnedLayerFlagOwned(); void constructNonOwnedLayerFlagOwned();
@ -126,7 +126,7 @@ struct MaterialDataTest: TestSuite::Tester {
void accessTextureSwizzle(); void accessTextureSwizzle();
void accessMutable(); void accessMutable();
void accessOptional(); void accessOptional();
void accessOutOfBounds(); void accessOutOfRange();
void accessNotFound(); void accessNotFound();
void accessInvalidAttributeName(); void accessInvalidAttributeName();
void accessWrongType(); void accessWrongType();
@ -150,11 +150,11 @@ struct MaterialDataTest: TestSuite::Tester {
void accessLayerIndexOptional(); void accessLayerIndexOptional();
void accessLayerNameOptional(); void accessLayerNameOptional();
void accessLayerStringOptional(); void accessLayerStringOptional();
void accessLayerOutOfBounds(); void accessLayerOutOfRange();
void accessLayerNotFound(); void accessLayerNotFound();
void accessInvalidLayerName(); void accessInvalidLayerName();
void accessOutOfBoundsInLayerIndex(); void accessOutOfRangeInLayerIndex();
void accessOutOfBoundsInLayerString(); void accessOutOfRangeInLayerString();
void accessNotFoundInLayerIndex(); void accessNotFoundInLayerIndex();
void accessNotFoundInLayerString(); void accessNotFoundInLayerString();
void accessMutableNotAllowed(); void accessMutableNotAllowed();
@ -268,7 +268,7 @@ MaterialDataTest::MaterialDataTest() {
&MaterialDataTest::constructLayers, &MaterialDataTest::constructLayers,
&MaterialDataTest::constructLayersNotMonotonic, &MaterialDataTest::constructLayersNotMonotonic,
&MaterialDataTest::constructLayersOffsetOutOfBounds, &MaterialDataTest::constructLayersOffsetOutOfRange,
&MaterialDataTest::constructLayersLastOffsetTooShort, &MaterialDataTest::constructLayersLastOffsetTooShort,
&MaterialDataTest::constructNonOwned, &MaterialDataTest::constructNonOwned,
@ -277,7 +277,7 @@ MaterialDataTest::MaterialDataTest() {
&MaterialDataTest::constructNonOwnedNotSorted, &MaterialDataTest::constructNonOwnedNotSorted,
&MaterialDataTest::constructNonOwnedDuplicateAttribute, &MaterialDataTest::constructNonOwnedDuplicateAttribute,
&MaterialDataTest::constructNonOwnedLayersNotMonotonic, &MaterialDataTest::constructNonOwnedLayersNotMonotonic,
&MaterialDataTest::constructNonOwnedLayersOffsetOutOfBounds, &MaterialDataTest::constructNonOwnedLayersOffsetOutOfRange,
&MaterialDataTest::constructNonOwnedLayersLastOffsetTooShort, &MaterialDataTest::constructNonOwnedLayersLastOffsetTooShort,
&MaterialDataTest::constructNonOwnedAttributeFlagOwned, &MaterialDataTest::constructNonOwnedAttributeFlagOwned,
&MaterialDataTest::constructNonOwnedLayerFlagOwned, &MaterialDataTest::constructNonOwnedLayerFlagOwned,
@ -295,7 +295,7 @@ MaterialDataTest::MaterialDataTest() {
&MaterialDataTest::accessTextureSwizzle, &MaterialDataTest::accessTextureSwizzle,
&MaterialDataTest::accessMutable, &MaterialDataTest::accessMutable,
&MaterialDataTest::accessOptional, &MaterialDataTest::accessOptional,
&MaterialDataTest::accessOutOfBounds, &MaterialDataTest::accessOutOfRange,
&MaterialDataTest::accessNotFound, &MaterialDataTest::accessNotFound,
&MaterialDataTest::accessInvalidAttributeName, &MaterialDataTest::accessInvalidAttributeName,
&MaterialDataTest::accessWrongType, &MaterialDataTest::accessWrongType,
@ -319,11 +319,11 @@ MaterialDataTest::MaterialDataTest() {
&MaterialDataTest::accessLayerIndexOptional, &MaterialDataTest::accessLayerIndexOptional,
&MaterialDataTest::accessLayerNameOptional, &MaterialDataTest::accessLayerNameOptional,
&MaterialDataTest::accessLayerStringOptional, &MaterialDataTest::accessLayerStringOptional,
&MaterialDataTest::accessLayerOutOfBounds, &MaterialDataTest::accessLayerOutOfRange,
&MaterialDataTest::accessLayerNotFound, &MaterialDataTest::accessLayerNotFound,
&MaterialDataTest::accessInvalidLayerName, &MaterialDataTest::accessInvalidLayerName,
&MaterialDataTest::accessOutOfBoundsInLayerIndex, &MaterialDataTest::accessOutOfRangeInLayerIndex,
&MaterialDataTest::accessOutOfBoundsInLayerString, &MaterialDataTest::accessOutOfRangeInLayerString,
&MaterialDataTest::accessNotFoundInLayerIndex, &MaterialDataTest::accessNotFoundInLayerIndex,
&MaterialDataTest::accessNotFoundInLayerString, &MaterialDataTest::accessNotFoundInLayerString,
&MaterialDataTest::accessMutableNotAllowed, &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"); 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(); CORRADE_SKIP_IF_NO_ASSERT();
std::ostringstream out; 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"); 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(); CORRADE_SKIP_IF_NO_ASSERT();
MaterialAttributeData attributes[]{ MaterialAttributeData attributes[]{
@ -2007,7 +2007,7 @@ void MaterialDataTest::accessOptional() {
CORRADE_COMPARE(data.attributeOr(MaterialAttribute::DiffuseTexture, 5u), 5); CORRADE_COMPARE(data.attributeOr(MaterialAttribute::DiffuseTexture, 5u), 5);
} }
void MaterialDataTest::accessOutOfBounds() { void MaterialDataTest::accessOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
MaterialData data{{}, { MaterialData data{{}, {
@ -2621,7 +2621,7 @@ void MaterialDataTest::accessLayerStringOptional() {
CORRADE_COMPARE(data.attributeOr("ClearCoat", MaterialAttribute::DiffuseTexture, 5u), 5); CORRADE_COMPARE(data.attributeOr("ClearCoat", MaterialAttribute::DiffuseTexture, 5u), 5);
} }
void MaterialDataTest::accessLayerOutOfBounds() { void MaterialDataTest::accessLayerOutOfRange() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
MaterialData data{{}, { MaterialData data{{}, {
@ -2899,7 +2899,7 @@ void MaterialDataTest::accessInvalidLayerName() {
"Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n"); "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n");
} }
void MaterialDataTest::accessOutOfBoundsInLayerIndex() { void MaterialDataTest::accessOutOfRangeInLayerIndex() {
CORRADE_SKIP_IF_NO_ASSERT(); CORRADE_SKIP_IF_NO_ASSERT();
MaterialData data{{}, { MaterialData data{{}, {
@ -2930,7 +2930,7 @@ void MaterialDataTest::accessOutOfBoundsInLayerIndex() {
"Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 attributes in layer 1\n"); "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(); CORRADE_SKIP_IF_NO_ASSERT();
MaterialData data{{}, { MaterialData data{{}, {

70
src/Magnum/Trade/Test/SceneDataTest.cpp

@ -294,7 +294,7 @@ const struct {
{5, 5, 5, 5, 5}, 3, 0, 3}, {5, 5, 5, 5, 5}, 3, 0, 3},
{"implicit, not found", SceneFieldFlag::ImplicitMapping, {"implicit, not found", SceneFieldFlag::ImplicitMapping,
/* Is there but the assumption is that the ID matches the offset, which /* 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}, {5, 5, 5, 5, 5}, 5, 0, Containers::NullOpt},
{"implicit, offset", SceneFieldFlag::ImplicitMapping, {"implicit, offset", SceneFieldFlag::ImplicitMapping,
/* Not there but the assumption is that the ID matches the offset; /* 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 /* Cerifying that the offset is properly accounted for -- it's never
found if offset > id */ found if offset > id */
{5, 5, 5, 5, 5}, 3, 4, Containers::NullOpt}, {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} {5, 5, 5, 5, 5}, 5, 4, Containers::NullOpt}
}; };
@ -4336,10 +4336,10 @@ void SceneDataTest::findFieldObjectOffsetInvalidOffset() {
scene.fieldObjectOffset(0, 1, 4); scene.fieldObjectOffset(0, 1, 4);
scene.fieldObjectOffset(SceneField::Mesh, 1, 4); scene.fieldObjectOffset(SceneField::Mesh, 1, 4);
CORRADE_COMPARE(out.str(), 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 range for a field of size 3\n"
"Trade::SceneData::findFieldObjectOffset(): 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::fieldObjectOffset(): offset 4 out of bounds 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 bounds 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() { void SceneDataTest::fieldObjectOffsetNotFound() {
@ -4542,8 +4542,8 @@ void SceneDataTest::mappingIntoArrayInvalidSizeOrOffset() {
CORRADE_COMPARE(out.str(), 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(): 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 range 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");
} }
template<class T> void SceneDataTest::parentsAsArray() { template<class T> void SceneDataTest::parentsAsArray() {
@ -4661,7 +4661,7 @@ void SceneDataTest::parentsIntoArrayInvalidSizeOrOffset() {
CORRADE_COMPARE(out.str(), 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 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(): 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"); "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(), 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 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(): 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"); "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 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 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(): 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 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 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" "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(), 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 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(): 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"); "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 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 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(): 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 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 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" "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 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 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(): 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 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(): 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"); "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(), 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 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(): 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"); "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(), 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 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(): 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"); "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(), 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 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(): 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"); "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(), 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 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(): 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"); "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.camerasFor(7);
scene.skinsFor(7); scene.skinsFor(7);
CORRADE_COMPARE(out.str(), CORRADE_COMPARE(out.str(),
"Trade::SceneData::findFieldObjectOffset(): 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 bounds for 7 objects\n" "Trade::SceneData::findFieldObjectOffset(): object 7 out of range for 7 objects\n"
"Trade::SceneData::fieldObjectOffset(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::fieldObjectOffset(): object 7 out of range for 7 objects\n"
"Trade::SceneData::fieldObjectOffset(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::fieldObjectOffset(): object 7 out of range for 7 objects\n"
"Trade::SceneData::hasFieldObject(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::hasFieldObject(): object 7 out of range for 7 objects\n"
"Trade::SceneData::hasFieldObject(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::hasFieldObject(): object 7 out of range for 7 objects\n"
"Trade::SceneData::parentFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::parentFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::childrenFor(): object -2 out of bounds for 7 objects\n" "Trade::SceneData::childrenFor(): object -2 out of range for 7 objects\n"
"Trade::SceneData::childrenFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::childrenFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::transformation2DFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::transformation2DFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::translationRotationScaling2DFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::translationRotationScaling2DFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::transformation3DFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::transformation3DFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::translationRotationScaling3DFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::translationRotationScaling3DFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::meshesMaterialsFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::meshesMaterialsFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::lightsFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::lightsFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::camerasFor(): object 7 out of bounds for 7 objects\n" "Trade::SceneData::camerasFor(): object 7 out of range for 7 objects\n"
"Trade::SceneData::skinsFor(): object 7 out of bounds for 7 objects\n"); "Trade::SceneData::skinsFor(): object 7 out of range for 7 objects\n");
} }
void SceneDataTest::releaseFieldData() { void SceneDataTest::releaseFieldData() {

2
src/Magnum/Vk/DeviceProperties.cpp

@ -615,7 +615,7 @@ Containers::Optional<DeviceProperties> tryPickDevice(Instance& instance) {
Containers::Array<DeviceProperties> devices{NoInit, id + 1}; Containers::Array<DeviceProperties> devices{NoInit, id + 1};
const UnsignedInt count = Implementation::enumerateDevicesInto(instance, devices); const UnsignedInt count = Implementation::enumerateDevicesInto(instance, devices);
if(id >= count) { 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 {}; return {};
} }

4
src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp

@ -102,8 +102,8 @@ const struct {
} PickDeviceErrorData[] { } PickDeviceErrorData[] {
{"nothing for type found", Containers::array({"", "--magnum-device", "virtual"}), {"nothing for type found", Containers::array({"", "--magnum-device", "virtual"}),
"Vk::tryPickDevice(): no Vk::DeviceType::VirtualGpu found among {} Vulkan devices\n"}, "Vk::tryPickDevice(): no Vk::DeviceType::VirtualGpu found among {} Vulkan devices\n"},
{"index out of bounds", Containers::array({"", "--magnum-device", "666"}), {"index out of range", Containers::array({"", "--magnum-device", "666"}),
"Vk::tryPickDevice(): index 666 out of bounds for {} Vulkan devices\n"}, "Vk::tryPickDevice(): index 666 out of range for {} Vulkan devices\n"},
{"unknown type", Containers::array({"", "--magnum-device", "FAST"}), {"unknown type", Containers::array({"", "--magnum-device", "FAST"}),
"Vk::tryPickDevice(): unknown Vulkan device type FAST\n"} "Vk::tryPickDevice(): unknown Vulkan device type FAST\n"}
}; };

2
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 /* Not really a problem right now, but once people hit this we might
want to guard against this (especially because the Index might be want to guard against this (especially because the Index might be
out of bounds) */ out of range) */
struct GLExtension { struct GLExtension {
enum: std::size_t { Index }; enum: std::size_t { Index };
}; };

4
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, 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, 19, 0, 0, 0, 0, 0, 0, 0,
'T', 'R', 'U', 'E', 'V', 'I', 'S', 'I', 'O', 'N', '-', 'X', 'F', 'I', 'L', 'E', '.', '\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, { {"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, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0,
0, 0, 0, 0, 17, 0, 0, 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, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0,
0, 0, 0, 0, 19, 0, 0, 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' '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, { {"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, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 24, 0,
'\xdd', '\xee', '\xee', '\xdd', '\xee', '\xee',

4
src/MagnumPlugins/TgaImporter/TgaImporter.cpp

@ -154,7 +154,7 @@ Containers::Optional<ImageData2D> TgaImporter::doImage2D(UnsignedInt, UnsignedIn
return {}; return {};
} }
if(extensionOffset > _in.size() - sizeof(Implementation::TgaFooter)) { 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 {}; return {};
} }
@ -168,7 +168,7 @@ Containers::Optional<ImageData2D> TgaImporter::doImage2D(UnsignedInt, UnsignedIn
return {}; return {};
} }
if(developerAreaOffset > _in.size() - sizeof(Implementation::TgaFooter)) { 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 {}; return {};
} }

Loading…
Cancel
Save