From 0143ad45d9efe25aeed9cec70a6dba0347854db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 7 Jun 2022 18:08:37 +0200 Subject: [PATCH] Trade: no need to fall back to std::string for concatenation anymore. --- src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp | 10 +++++----- .../Test/PbrMetallicRoughnessMaterialDataTest.cpp | 10 +++++----- .../Test/PbrSpecularGlossinessMaterialDataTest.cpp | 10 +++++----- src/Magnum/Trade/Test/PhongMaterialDataTest.cpp | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp index a6c0d3c36..3add83e02 100644 --- a/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp +++ b/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 */ diff --git a/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp index ea03bd3dc..e8b93e1f0 100644 --- a/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp +++ b/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 */ diff --git a/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp index 528d90791..bd5c59189 100644 --- a/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp +++ b/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 */ diff --git a/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp b/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp index 9f37b3e12..9d6dea1ce 100644 --- a/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp +++ b/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 */