From 826329258ad0dcf71f007b26fb5cfb8f3cc9c65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 2 Feb 2023 12:45:20 +0100 Subject: [PATCH] Math: adapt to changes in Corrade's TweakableParser also for Angle. Forgot to do this in 4ef33236eb5b3b229504ba15a40eaa599ff65e74. --- src/Magnum/Math/Half.cpp | 3 ++- src/Magnum/Math/Half.h | 3 +-- src/Magnum/Math/Test/HalfTest.cpp | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Magnum/Math/Half.cpp b/src/Magnum/Math/Half.cpp index eba7515a2..47f2ebf44 100644 --- a/src/Magnum/Math/Half.cpp +++ b/src/Magnum/Math/Half.cpp @@ -30,6 +30,7 @@ #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 #endif @@ -49,7 +50,7 @@ Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, Half value) #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) namespace Corrade { namespace Utility { -std::pair TweakableParser::parse(const Containers::StringView value) { +Containers::Pair TweakableParser::parse(const Containers::StringView value) { using namespace Containers::Literals; char* end; diff --git a/src/Magnum/Math/Half.h b/src/Magnum/Math/Half.h index 52584014c..80d82529e 100644 --- a/src/Magnum/Math/Half.h +++ b/src/Magnum/Math/Half.h @@ -29,7 +29,6 @@ * @brief Class @ref Magnum::Math::Half, literal @link Magnum::Math::Literals::operator""_h() @endlink */ -#include #ifndef CORRADE_NO_DEBUG #include #endif @@ -214,7 +213,7 @@ template<> struct MAGNUM_EXPORT TweakableParser { TweakableParser() = delete; /** @brief Parse the value */ - static std::pair parse(Containers::StringView value); + static Containers::Pair parse(Containers::StringView value); }; }} diff --git a/src/Magnum/Math/Test/HalfTest.cpp b/src/Magnum/Math/Test/HalfTest.cpp index 0ba1b1241..2325c8132 100644 --- a/src/Magnum/Math/Test/HalfTest.cpp +++ b/src/Magnum/Math/Test/HalfTest.cpp @@ -639,11 +639,9 @@ void HalfTest::debug() { void HalfTest::tweakable() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Utility::TweakableState state; - Half result; - std::tie(state, result) = Corrade::Utility::TweakableParser::parse(data.data); - CORRADE_COMPARE(state, Corrade::Utility::TweakableState::Success); - CORRADE_COMPARE(result, data.result); + auto result = Corrade::Utility::TweakableParser::parse(data.data); + CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + CORRADE_COMPARE(result.second(), data.result); } void HalfTest::tweakableError() { @@ -653,7 +651,7 @@ void HalfTest::tweakableError() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(data.data).first; + Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(data.data).first(); CORRADE_COMPARE(out.str(), data.error); CORRADE_COMPARE(state, data.state); }