Browse Source

Trade: no need to fall back to std::string for concatenation anymore.

pull/570/head
Vladimír Vondruš 4 years ago
parent
commit
0143ad45d9
  1. 10
      src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp
  2. 10
      src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp
  3. 10
      src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp
  4. 10
      src/Magnum/Trade/Test/PhongMaterialDataTest.cpp

10
src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp

@ -368,8 +368,8 @@ void PbrClearCoatMaterialDataTest::commonTransformationCoordinatesOneTexture() {
{MaterialLayer::ClearCoat},
{textureName, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
}, {2, 6}};
CORRADE_VERIFY(data.hasCommonTextureTransformation());
@ -392,8 +392,8 @@ void PbrClearCoatMaterialDataTest::commonTransformationCoordinatesOneDifferentTe
{MaterialAttribute::LayerFactorTexture, 2u},
{MaterialAttribute::RoughnessTexture, 3u},
{MaterialAttribute::NormalTexture, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u}
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u}
}, {2, 8}};
CORRADE_VERIFY(!data.hasCommonTextureTransformation());
@ -410,7 +410,7 @@ void PbrClearCoatMaterialDataTest::commonCoordinatesImplicit() {
PbrClearCoatMaterialData data{{}, {
{MaterialLayer::ClearCoat},
{textureName, 5u},
{std::string{textureName} + "Coordinates", 0u}
{textureName + "Coordinates", 0u}
}, {0, 3}};
/* Zero is treated same as if there would be no attribute at all */

10
src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp

@ -783,8 +783,8 @@ void PbrMetallicRoughnessMaterialDataTest::commonTransformationCoordinatesOneTex
PbrMetallicRoughnessMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These shouldn't affect the above */
{MaterialAttribute::TextureMatrix, Matrix3::translation({0.5f, 0.0f})},
@ -808,8 +808,8 @@ void PbrMetallicRoughnessMaterialDataTest::commonTransformationCoordinatesOneDif
{MaterialAttribute::NormalTexture, 5u},
{MaterialAttribute::OcclusionTexture, 6u},
{MaterialAttribute::EmissiveTexture, 7u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These are used by all textures except the one above, failing the
check */
@ -830,7 +830,7 @@ void PbrMetallicRoughnessMaterialDataTest::commonCoordinatesImplicit() {
PbrMetallicRoughnessMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Coordinates", 0u}
{textureName + "Coordinates", 0u}
}};
/* Zero is treated same as if there would be no attribute at all */

10
src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp

@ -499,8 +499,8 @@ void PbrSpecularGlossinessMaterialDataTest::commonTransformationCoordinatesOneTe
PbrSpecularGlossinessMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These shouldn't affect the above */
{MaterialAttribute::TextureMatrix, Matrix3::translation({0.5f, 0.0f})},
@ -524,8 +524,8 @@ void PbrSpecularGlossinessMaterialDataTest::commonTransformationCoordinatesOneDi
{MaterialAttribute::NormalTexture, 5u},
{MaterialAttribute::OcclusionTexture, 6u},
{MaterialAttribute::EmissiveTexture, 7u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These are used by all textures except the one above, failing the
check */
@ -546,7 +546,7 @@ void PbrSpecularGlossinessMaterialDataTest::commonCoordinatesImplicit() {
PbrSpecularGlossinessMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Coordinates", 0u}
{textureName + "Coordinates", 0u}
}};
/* Zero is treated same as if there would be no attribute at all */

10
src/Magnum/Trade/Test/PhongMaterialDataTest.cpp

@ -533,8 +533,8 @@ void PhongMaterialDataTest::commonTransformationCoordinatesOneTexture() {
PhongMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These shouldn't affect the above */
{MaterialAttribute::TextureMatrix, Matrix3::translation({0.5f, 0.0f})},
@ -564,8 +564,8 @@ void PhongMaterialDataTest::commonTransformationCoordinatesOneDifferentTexture()
{MaterialAttribute::DiffuseTexture, 3u},
{MaterialAttribute::SpecularTexture, 4u},
{MaterialAttribute::NormalTexture, 5u},
{std::string{textureName} + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{std::string{textureName} + "Coordinates", 17u},
{textureName + "Matrix", Matrix3::scaling({0.5f, 1.0f})},
{textureName + "Coordinates", 17u},
/* These are used by all textures except the one above, failing the
check */
@ -594,7 +594,7 @@ void PhongMaterialDataTest::commonCoordinatesImplicit() {
PhongMaterialData data{{}, {
{textureName, 5u},
{std::string{textureName} + "Coordinates", 0u}
{textureName + "Coordinates", 0u}
}};
/* Zero is treated same as if there would be no attribute at all */

Loading…
Cancel
Save