From 063f24acf6fe8181bc9d924384b767ab61fa1421 Mon Sep 17 00:00:00 2001 From: FreePhoenix888 Date: Fri, 21 Oct 2022 11:06:51 +0500 Subject: [PATCH] Initialize constants constexpr --- cpp/Platform.Data.Tests/LinksConstantsTests.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/Platform.Data.Tests/LinksConstantsTests.cpp b/cpp/Platform.Data.Tests/LinksConstantsTests.cpp index ec7a739d..d2c0fb6a 100644 --- a/cpp/Platform.Data.Tests/LinksConstantsTests.cpp +++ b/cpp/Platform.Data.Tests/LinksConstantsTests.cpp @@ -15,17 +15,16 @@ using namespace Platform::Data; using namespace Platform::Ranges; - TUnsigned unsingedOne = 1; - TUnsigned half = std::numeric_limits::max(); - auto constants = LinksConstants(Range{unsingedOne, half}, Range{TUnsigned(half + unsingedOne), std::numeric_limits::max()}); + constexpr TUnsigned unsingedOne = 1; + constexpr TUnsigned half = std::numeric_limits::max(); + constexpr LinksConstants constants {Range{unsingedOne, half}, Range{TUnsigned(half + unsingedOne), std::numeric_limits::max()}}; auto minimum = Hybrid(0, true); auto maximum = Hybrid(half, true); - - ASSERT_TRUE(IsExternalReference(constants, minimum.Value)); + ASSERT_TRUE((IsExternalReference(minimum.Value))); ASSERT_TRUE(minimum.IsExternal()); ASSERT_FALSE(minimum.IsInternal()); - ASSERT_TRUE(IsExternalReference(constants, maximum.Value)); + ASSERT_TRUE((IsExternalReference(maximum.Value))); ASSERT_TRUE(maximum.IsExternal()); ASSERT_FALSE(maximum.IsInternal()); }