From c5fbb8ad04cc6ca6e65111a63faaad8c5dfc39cc 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 | 4 +--- src/Magnum/Vk/Test/InstanceVkTest.cpp | 4 ++-- src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp | 4 +--- src/Magnum/Vk/VulkanTester.cpp | 1 - 16 files changed, 25 insertions(+), 28 deletions(-) diff --git a/doc/snippets/MagnumVk.cpp b/doc/snippets/MagnumVk.cpp index 44c5c61a84..ed3a3e3efc 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 893c735ac5..465b6937ff 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 84197547bc..5a55c5548a 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 b48c7a243f..2015e43bad 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 fc7bba2c01..2bad84d742 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 d90a53f75b..f73a53d3da 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 77f318e258..bdf8434d3e 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 ab5b3dbc2d..2963db5019 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 b6773439e3..6d06df7377 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 12b3536fea..d5256bcbe4 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 32a84126b9..5210189bb1 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 89da474fd1..226d47b9d6 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 f1ac01a60c..b39d911306 100644 --- a/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -169,8 +168,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 f4e78e584e..b7b4bb7300 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 e8d795876a..f4c5469a1b 100644 --- a/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp @@ -24,7 +24,6 @@ */ #include -#include #include #include #include @@ -136,8 +135,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 c985161ce4..ab679c8bfc 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"