From 5d0454ce981ec71386df36c176756bd35e48abba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 31 Dec 2022 03:12:06 +0100 Subject: [PATCH] Remove random unneeded and StringStl.h includes. Or document why is it still needed. --- doc/snippets/MagnumVk.cpp | 1 - src/Magnum/GL/Test/ContextGLTest.cpp | 2 +- .../Platform/WindowlessEglApplication.cpp | 3 +-- .../TextureTools/Test/DistanceFieldGLTest.cpp | 1 - src/Magnum/Trade/AbstractImageConverter.cpp | 1 - src/Magnum/Trade/Test/MaterialDataTest.cpp | 2 +- .../Test/PbrClearCoatMaterialDataTest.cpp | 2 +- .../PbrMetallicRoughnessMaterialDataTest.cpp | 2 +- .../PbrSpecularGlossinessMaterialDataTest.cpp | 2 +- .../Trade/Test/PhongMaterialDataTest.cpp | 2 +- src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp | 1 - src/Magnum/Vk/Test/DeviceVkTest.cpp | 21 ++++++++++++------- .../Vk/Test/ExtensionPropertiesVkTest.cpp | 5 ++--- src/Magnum/Vk/Test/InstanceVkTest.cpp | 4 ++-- src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp | 5 ++--- src/Magnum/Vk/VulkanTester.cpp | 1 - 16 files changed, 27 insertions(+), 28 deletions(-) diff --git a/doc/snippets/MagnumVk.cpp b/doc/snippets/MagnumVk.cpp index 44c5c61a8..ed3a3e3ef 100644 --- a/doc/snippets/MagnumVk.cpp +++ b/doc/snippets/MagnumVk.cpp @@ -23,7 +23,6 @@ DEALINGS IN THE SOFTWARE. */ -#include #include #include #include diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 893c735ac..465b6937f 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include /* contains() on std::string */ #include #include diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index 84197547b..5a55c5548 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -27,8 +27,7 @@ #include "WindowlessEglApplication.h" -#include /** @todo used by extensionSupported(), cleann up */ -#include +#include /** @todo used by extensionSupported(), clean up */ #include #include #include diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index b48c7a243..2015e43ba 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -24,7 +24,6 @@ */ #include -#include /** @todo remove when AbstractImporter is -free */ #include #include diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index fc7bba2c0..2bad84d74 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -29,7 +29,6 @@ #include #include #include -#include /** @todo remove once PluginManager is -free */ #include #include #include diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp index d90a53f75..f73a53d3d 100644 --- a/src/Magnum/Trade/Test/MaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp @@ -26,7 +26,7 @@ #include /* std::next_permutation() */ #include #include -#include +#include /* partition() on a std::string */ #include #include #include diff --git a/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp index 77f318e25..bdf8434d3 100644 --- a/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include diff --git a/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp index ab5b3dbc2..2963db501 100644 --- a/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include diff --git a/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp b/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp index b6773439e..6d06df737 100644 --- a/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include diff --git a/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp b/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp index 12b3536fe..d5256bcbe 100644 --- a/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/PhongMaterialDataTest.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include diff --git a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp index 32a84126b..5210189bb 100644 --- a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Magnum/Vk/Test/DeviceVkTest.cpp b/src/Magnum/Vk/Test/DeviceVkTest.cpp index 89da474fd..226d47b9d 100644 --- a/src/Magnum/Vk/Test/DeviceVkTest.cpp +++ b/src/Magnum/Vk/Test/DeviceVkTest.cpp @@ -27,8 +27,9 @@ #include #include #include -#include +#include /* StringHasPrefix */ #include +#include #include #include @@ -785,11 +786,14 @@ void DeviceVkTest::constructExtensionsCommandLineDisable() { UnsignedInt major = versionMajor(deviceProperties.version()); UnsignedInt minor = versionMinor(deviceProperties.version()); UnsignedInt patch = versionPatch(deviceProperties.version()); - /* SwiftShader reports just 1.1 with no patch version, special-case that */ - std::string expected = Utility::formatString(data.log, deviceProperties.name(), major, minor, patch ? Utility::formatString(".{}", patch) : "", deviceProperties.driverName(), deviceProperties.driverInfo()); /* The output might contain a device workaround list, cut that away. That's tested thoroughly in constructWorkaroundsCommandLineDisable(). */ - CORRADE_COMPARE(out.str().substr(0, expected.size()), expected); + CORRADE_COMPARE_AS(out.str(), + Utility::format(data.log, deviceProperties.name(), major, minor, + /* SwiftShader reports just 1.1 with no patch version, special-case + that */ + patch ? Utility::format(".{}", patch) : "", deviceProperties.driverName(), deviceProperties.driverInfo()), + TestSuite::Compare::StringHasPrefix); /* Verify that the entrypoint is actually (not) loaded as expected, to avoid all the above reporting being just smoke & mirrors */ @@ -842,11 +846,14 @@ void DeviceVkTest::constructExtensionsCommandLineEnable() { UnsignedInt major = versionMajor(deviceProperties.version()); UnsignedInt minor = versionMinor(deviceProperties.version()); UnsignedInt patch = versionPatch(deviceProperties.version()); - /* SwiftShader reports just 1.1 with no patch version, special-case that */ - std::string expected = Utility::formatString(data.log, deviceProperties.name(), major, minor, patch ? Utility::formatString(".{}", patch) : "", deviceProperties.driverName(), deviceProperties.driverInfo()); /* The output might contain a device workaround list, cut that away. That's tested thoroughly in constructWorkaroundsCommandLineDisable(). */ - CORRADE_COMPARE(out.str().substr(0, expected.size()), expected); + CORRADE_COMPARE_AS(out.str(), + Utility::format(data.log, deviceProperties.name(), major, minor, + /* SwiftShader reports just 1.1 with no patch version, special-case + that */ + patch ? Utility::format(".{}", patch) : "", deviceProperties.driverName(), deviceProperties.driverInfo()), + TestSuite::Compare::StringHasPrefix); /* Verify that the entrypoint is actually (not) loaded as expected, to avoid all the above reporting being just smoke & mirrors */ diff --git a/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp b/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp index f1ac01a60..01fffa5af 100644 --- a/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp @@ -24,8 +24,8 @@ */ #include +#include #include -#include #include #include #include @@ -169,8 +169,7 @@ void ExtensionPropertiesVkTest::instanceExtensionIsSupported() { CORRADE_VERIFY(!properties.isSupported("ZZZZZ")); /* Verify that we're not just comparing a prefix */ - const std::string extension = std::string(properties.name(0)) + "_hello"; - CORRADE_VERIFY(!properties.isSupported(extension)); + CORRADE_VERIFY(!properties.isSupported(properties.name(0) + "_hello"_s)); /* This extension should be available almost always */ if(!properties.isSupported("VK_KHR_get_physical_device_properties2")) diff --git a/src/Magnum/Vk/Test/InstanceVkTest.cpp b/src/Magnum/Vk/Test/InstanceVkTest.cpp index f4e78e584..b7b4bb730 100644 --- a/src/Magnum/Vk/Test/InstanceVkTest.cpp +++ b/src/Magnum/Vk/Test/InstanceVkTest.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -432,7 +432,7 @@ void InstanceVkTest::constructCommandLineEnable() { UnsignedInt minor = versionMinor(enumerateInstanceVersion()); UnsignedInt patch = versionPatch(enumerateInstanceVersion()); /* Vulkan 1.0 instances report no patch version, special-case that */ - CORRADE_COMPARE(out.str(), Utility::formatString(data.log, major, minor, patch ? Utility::formatString(".{}", patch) : "")); + CORRADE_COMPARE(out.str(), Utility::formatString(data.log, major, minor, patch ? Utility::format(".{}", patch) : "")); /* Verify that the entrypoint is actually (not) loaded as expected, to avoid all the above reporting being just smoke & mirrors */ diff --git a/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp b/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp index e8d795876..4fe476cc7 100644 --- a/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include #include @@ -136,8 +136,7 @@ void LayerPropertiesVkTest::isSupported() { } /* Verify that we're not just comparing a prefix */ - const std::string layer = std::string(properties.name(0)) + "_hello"; - CORRADE_VERIFY(!properties.isSupported(layer)); + CORRADE_VERIFY(!properties.isSupported(properties.name(0) + "_hello"_s)); } }}}} diff --git a/src/Magnum/Vk/VulkanTester.cpp b/src/Magnum/Vk/VulkanTester.cpp index c985161ce..ab679c8bf 100644 --- a/src/Magnum/Vk/VulkanTester.cpp +++ b/src/Magnum/Vk/VulkanTester.cpp @@ -25,7 +25,6 @@ #include "VulkanTester.h" -#include /* sigh, for setSkippedArgumentPrefixes() */ #include #include "Magnum/Vk/DeviceCreateInfo.h"