From 3b2ad338e2cae58c75f44b3a24fe77314365217e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 19 Feb 2022 19:15:49 +0100 Subject: [PATCH] Port from Utility::formatString() to Utility::format() where possible. There's still many cases where the formatted string is compared to a std::stringstream, there it doesn't make sense to switch. --- src/Magnum/DebugTools/FrameProfiler.cpp | 5 +- src/Magnum/Math/Test/AngleTest.cpp | 8 +-- src/Magnum/Math/Test/ColorTest.cpp | 58 ++++++++----------- src/Magnum/SceneTools/sceneconverter.cpp | 28 ++++----- .../Test/AnyConverterTest.cpp | 10 ++-- 5 files changed, 50 insertions(+), 59 deletions(-) diff --git a/src/Magnum/DebugTools/FrameProfiler.cpp b/src/Magnum/DebugTools/FrameProfiler.cpp index 06f7c87e2..f4ba37b02 100644 --- a/src/Magnum/DebugTools/FrameProfiler.cpp +++ b/src/Magnum/DebugTools/FrameProfiler.cpp @@ -29,8 +29,9 @@ #include #include #include +#include #include -#include +#include #include #include "Magnum/Math/Functions.h" @@ -294,7 +295,7 @@ namespace { void printValue(Utility::Debug& out, const Double mean, const Double divisor, const char* const unitPrefix, const char* const units) { out << Debug::boldColor(Debug::Color::Green) - << Utility::formatString("{:.2f}", mean/divisor) << Debug::resetColor + << Utility::format("{:.2f}", mean/divisor) << Debug::resetColor << Debug::nospace << unitPrefix << Debug::nospace << units; } diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index b524f4f44..b27b95d19 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -29,7 +29,7 @@ #include #include #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) -#include +#include #include #include #endif @@ -299,10 +299,9 @@ template void AngleTest::tweakable() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseTemplateName(TweakableTraits::name()); setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, TweakableTraits::literal()); Corrade::Utility::TweakableState state; T result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, TweakableTraits::literal())); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, T(typename T::Type(data.result))); } @@ -311,12 +310,11 @@ template void AngleTest::tweakableError() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseTemplateName(TweakableTraits::name()); setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, TweakableTraits::literal()); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, TweakableTraits::literal())).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, TweakableTraits::literal())); CORRADE_COMPARE(state, data.state); } diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 9a59df7cd..660e8fd27 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -28,7 +28,7 @@ #include #include #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) -#include +#include #include #include #endif @@ -1104,10 +1104,10 @@ void ColorTest::debugHsv() { void ColorTest::tweakableRgb() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgb, "rgb"); + Corrade::Utility::TweakableState state; Color3ub result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "rgb")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultUb.rgb()); } @@ -1115,10 +1115,10 @@ void ColorTest::tweakableRgb() { void ColorTest::tweakableSrgb() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgb, "srgb"); + Corrade::Utility::TweakableState state; Math::Vector3 result; - std::tie(state, result) = Corrade::Utility::TweakableParser>::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser>::parse(Corrade::Utility::format(data.dataRgb, "srgb")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultUb.rgb()); } @@ -1126,10 +1126,10 @@ void ColorTest::tweakableSrgb() { void ColorTest::tweakableRgba() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgba, "rgba"); + Corrade::Utility::TweakableState state; Color4ub result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "rgba")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultUb); } @@ -1137,10 +1137,10 @@ void ColorTest::tweakableRgba() { void ColorTest::tweakableSrgba() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgba, "srgba"); + Corrade::Utility::TweakableState state; Math::Vector4 result; - std::tie(state, result) = Corrade::Utility::TweakableParser>::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser>::parse(Corrade::Utility::format(data.dataRgba, "srgba")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultUb); } @@ -1148,10 +1148,10 @@ void ColorTest::tweakableSrgba() { void ColorTest::tweakableRgbf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgb, "rgbf"); + Corrade::Utility::TweakableState state; Color3 result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "rgbf")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.result.rgb()); } @@ -1159,10 +1159,10 @@ void ColorTest::tweakableRgbf() { void ColorTest::tweakableSrgbf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgb, "srgbf"); + Corrade::Utility::TweakableState state; Color3 result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "srgbf")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultSrgba.rgb()); } @@ -1170,10 +1170,10 @@ void ColorTest::tweakableSrgbf() { void ColorTest::tweakableRgbaf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgba, "rgbaf"); + Corrade::Utility::TweakableState state; Color4 result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "rgbaf")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.result); } @@ -1181,10 +1181,10 @@ void ColorTest::tweakableRgbaf() { void ColorTest::tweakableSrgbaf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.dataRgba, "srgbaf"); + Corrade::Utility::TweakableState state; Color4 result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(input); + std::tie(state, result) = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "srgbaf")); CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); CORRADE_COMPARE(result, data.resultSrgba); } @@ -1192,12 +1192,11 @@ void ColorTest::tweakableSrgbaf() { void ColorTest::tweakableErrorRgb() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366", "rgb"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "rgb")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgb", "")); CORRADE_COMPARE(state, data.state); } @@ -1205,12 +1204,11 @@ void ColorTest::tweakableErrorRgb() { void ColorTest::tweakableErrorSrgb() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366", "srgb"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser>::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser>::parse(Corrade::Utility::format(data.data, "ff3366", "srgb")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgb", "s")); CORRADE_COMPARE(state, data.state); } @@ -1218,12 +1216,11 @@ void ColorTest::tweakableErrorSrgb() { void ColorTest::tweakableErrorRgba() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366aa", "rgba"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "rgba")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgba", "")); CORRADE_COMPARE(state, data.state); } @@ -1231,12 +1228,11 @@ void ColorTest::tweakableErrorRgba() { void ColorTest::tweakableErrorSrgba() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366aa", "srgba"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser>::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser>::parse(Corrade::Utility::format(data.data, "ff3366aa", "srgba")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgba", "s")); CORRADE_COMPARE(state, data.state); } @@ -1244,12 +1240,11 @@ void ColorTest::tweakableErrorSrgba() { void ColorTest::tweakableErrorRgbf() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366", "rgbf"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "rgbf")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgbf", "")); CORRADE_COMPARE(state, data.state); } @@ -1257,12 +1252,11 @@ void ColorTest::tweakableErrorRgbf() { void ColorTest::tweakableErrorSrgbf() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366", "srgbf"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "srgbf")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgbf", "s")); CORRADE_COMPARE(state, data.state); } @@ -1270,12 +1264,11 @@ void ColorTest::tweakableErrorSrgbf() { void ColorTest::tweakableErrorRgbaf() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366aa", "rgbaf"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "rgbaf")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgbaf", "")); CORRADE_COMPARE(state, data.state); } @@ -1283,12 +1276,11 @@ void ColorTest::tweakableErrorRgbaf() { void ColorTest::tweakableErrorSrgbaf() { auto&& data = TweakableErrorData[testCaseInstanceId()]; setTestCaseDescription(data.name); - std::string input = Corrade::Utility::formatString(data.data, "ff3366aa", "srgbaf"); std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(input).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "srgbaf")).first; CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgbaf", "s")); CORRADE_COMPARE(state, data.state); } diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index 882b41fbe..fc66c2e06 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "Magnum/PixelFormat.h" @@ -730,7 +730,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") if(!info.name.empty()) d << info.name; d << Debug::newline; d << " bound:" << info.mappingBound << "objects," << info.mappingType - << "(" << Debug::nospace << Utility::formatString("{:.1f}", info.dataSize/1024.0f) << "kB)"; + << "(" << Debug::nospace << Utility::format("{:.1f}", info.dataSize/1024.0f) << "kB)"; for(const SceneFieldInfo& field: info.fields) { d << Debug::newline << " " << field.name; @@ -740,7 +740,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") } d << "@" << field.type; if(field.arraySize) - d << Debug::nospace << Utility::formatString("[{}]", field.arraySize); + d << Debug::nospace << Utility::format("[{}]", field.arraySize); d << Debug::nospace << "," << field.size << "entries"; if(field.flags) d << Debug::newline << " " << field.flags; @@ -782,7 +782,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") /* Print reference count only if there actually are scenes and they were parsed, otherwise this information is useless */ if(skinReferenceCount) - d << Utility::formatString("(referenced by {} objects)", skinReferenceCount[info.skin]); + d << Utility::format("(referenced by {} objects)", skinReferenceCount[info.skin]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; @@ -797,7 +797,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") /* Print reference count only if there actually are scenes and they were parsed, otherwise this information is useless */ if(lightReferenceCount) - d << Utility::formatString("(referenced by {} objects)", lightReferenceCount[info.light]); + d << Utility::format("(referenced by {} objects)", lightReferenceCount[info.light]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; @@ -818,7 +818,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") /* Print reference count only if there actually are scenes and they were parsed, otherwise this information is useless */ if(materialReferenceCount) - d << Utility::formatString("(referenced by {} objects)", materialReferenceCount[info.material]); + d << Utility::format("(referenced by {} objects)", materialReferenceCount[info.material]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; @@ -903,7 +903,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") /* Print reference count only if there actually are scenes and they were parsed, otherwise this information is useless */ if(meshReferenceCount) - d << Utility::formatString("(referenced by {} objects)", meshReferenceCount[info.mesh]); + d << Utility::format("(referenced by {} objects)", meshReferenceCount[info.mesh]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; @@ -912,12 +912,12 @@ is specified as well, the IDs reference attributes of the first mesh.)") d << " Level" << info.level << Debug::nospace << ":" << info.primitive << Debug::nospace << "," << info.vertexCount << "vertices (" << Debug::nospace - << Utility::formatString("{:.1f}", info.vertexDataSize/1024.0f) + << Utility::format("{:.1f}", info.vertexDataSize/1024.0f) << "kB)"; if(info.indexType != MeshIndexType{}) { d << Debug::newline << " " << info.indexCount << "indices, offset" << info.indexOffset << "@" << info.indexType << Debug::nospace << ", stride" << info.indexStride << "(" << Debug::nospace - << Utility::formatString("{:.1f}", info.indexDataSize/1024.0f) + << Utility::format("{:.1f}", info.indexDataSize/1024.0f) << "kB)"; if(!info.indexBounds.empty()) d << Debug::newline << " bounds:" << info.indexBounds; @@ -932,7 +932,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") } d << "@" << attribute.format; if(attribute.arraySize) - d << Debug::nospace << Utility::formatString("[{}]", attribute.arraySize); + d << Debug::nospace << Utility::format("[{}]", attribute.arraySize); d << Debug::nospace << ", stride" << attribute.stride; if(!attribute.bounds.empty()) @@ -947,7 +947,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") /* Print reference count only if there actually are materials and they were parsed, otherwise this information is useless */ if(textureReferenceCount) - d << Utility::formatString("(referenced by {} material attributes)", textureReferenceCount[info.texture]); + d << Utility::format("(referenced by {} material attributes)", textureReferenceCount[info.texture]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; @@ -971,11 +971,11 @@ is specified as well, the IDs reference attributes of the first mesh.)") and they were parsed otherwise this information is useless */ if(info.size.z() && image3DReferenceCount) - d << Utility::formatString("(referenced by {} textures)", image3DReferenceCount[info.image]); + d << Utility::format("(referenced by {} textures)", image3DReferenceCount[info.image]); else if(info.size.y() && image2DReferenceCount) - d << Utility::formatString("(referenced by {} textures)", image2DReferenceCount[info.image]); + d << Utility::format("(referenced by {} textures)", image2DReferenceCount[info.image]); else if(image1DReferenceCount) - d << Utility::formatString("(referenced by {} textures)", image1DReferenceCount[info.image]); + d << Utility::format("(referenced by {} textures)", image1DReferenceCount[info.image]); d << Debug::nospace << ":"; if(!info.name.empty()) d << info.name; diff --git a/src/MagnumPlugins/AnyShaderConverter/Test/AnyConverterTest.cpp b/src/MagnumPlugins/AnyShaderConverter/Test/AnyConverterTest.cpp index 7c42d4832..bf1225712 100644 --- a/src/MagnumPlugins/AnyShaderConverter/Test/AnyConverterTest.cpp +++ b/src/MagnumPlugins/AnyShaderConverter/Test/AnyConverterTest.cpp @@ -263,7 +263,7 @@ void AnyConverterTest::validateFile() { /* Make it print a warning so we know it's doing something */ CORRADE_COMPARE(converter->validateFile(Stage::Fragment, filename), - std::make_pair(true, Utility::formatString("WARNING: {}:10: 'reserved__identifier' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); + std::make_pair(true, Utility::format("WARNING: {}:10: 'reserved__identifier' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); } void AnyConverterTest::validateFilePluginLoadFailed() { @@ -341,7 +341,7 @@ void AnyConverterTest::validateFilePropagateFlags() { std::ostringstream out; Debug redirectDebug{&out}; CORRADE_COMPARE(converter->validateFile(Stage::Fragment, filename), - std::make_pair(false, Utility::formatString("WARNING: {}:10: 'reserved__identifier' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); + std::make_pair(false, Utility::format("WARNING: {}:10: 'reserved__identifier' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); CORRADE_COMPARE(out.str(), "ShaderTools::AnyConverter::validateFile(): using GlslShaderConverter (provided by GlslangShaderConverter)\n"); } @@ -416,7 +416,7 @@ void AnyConverterTest::validateFilePropagatePreprocess() { }); CORRADE_COMPARE(converter->validateFile(Stage::Fragment, filename), - std::make_pair(true, Utility::formatString("WARNING: {}:10: 'different__but_also_wrong' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); + std::make_pair(true, Utility::format("WARNING: {}:10: 'different__but_also_wrong' : identifiers containing consecutive underscores (\"__\") are reserved", filename))); } void AnyConverterTest::validateFilePropagateConfiguration() { @@ -434,7 +434,7 @@ void AnyConverterTest::validateFilePropagateConfiguration() { { CORRADE_COMPARE(converter->validateFile(Stage::Fragment, filename), - std::make_pair(false, Utility::formatString("ERROR: {}:2: '#version' : must occur first in shader \nERROR: 1 compilation errors. No code generated.", filename))); + std::make_pair(false, Utility::format("ERROR: {}:2: '#version' : must occur first in shader \nERROR: 1 compilation errors. No code generated.", filename))); } { converter->configuration().setValue("permissive", true); /* Lol stupid thing, apparently it has two differently worded messages @@ -667,7 +667,7 @@ void AnyConverterTest::validateDataPropagateConfiguration() { /* Lol stupid thing, apparently it has two differently worded messages for the same thing? Dumpster fire. */ CORRADE_COMPARE(converter->validateData(Stage::Fragment, Utility::Directory::read(filename)), - std::make_pair(true, Utility::formatString("WARNING: 0:0: '#version' : Illegal to have non-comment, non-whitespace tokens before #version"))); + std::make_pair(true, Utility::format("WARNING: 0:0: '#version' : Illegal to have non-comment, non-whitespace tokens before #version"))); } }