From 636749eff3be1b6cdf1610fac4d6a24640670781 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 18 Dec 2023 14:34:01 +0100 Subject: [PATCH] test: const correctness --- test/entt/core/hashed_string.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/entt/core/hashed_string.cpp b/test/entt/core/hashed_string.cpp index a37f5c6b4..3a555a010 100644 --- a/test/entt/core/hashed_string.cpp +++ b/test/entt/core/hashed_string.cpp @@ -44,7 +44,7 @@ TEST(HashedString, Functionalities) { ASSERT_EQ(foo_hs, foo_hs); ASSERT_NE(foo_hs, bar_hs); - entt::hashed_string hs{"foobar"}; + const entt::hashed_string hs{"foobar"}; ASSERT_EQ(static_cast(hs), expected_v); ASSERT_EQ(hs.value(), expected_v); @@ -66,7 +66,7 @@ TEST(HashedString, Functionalities) { TEST(HashedString, Empty) { using hash_type = entt::hashed_string::hash_type; - entt::hashed_string hs{}; + const entt::hashed_string hs{}; ASSERT_EQ(hs.size(), 0u); ASSERT_EQ(static_cast(hs), hash_type{}); @@ -75,7 +75,7 @@ TEST(HashedString, Empty) { TEST(HashedString, Correctness) { const char *foobar = "foobar"; - std::string_view view{"foobar__", 6}; + const std::string_view view{"foobar__", 6}; ASSERT_EQ(entt::hashed_string{foobar}, expected_v); ASSERT_EQ((entt::hashed_string{view.data(), view.size()}), expected_v); @@ -148,7 +148,7 @@ TEST(HashedWString, Functionalities) { ASSERT_EQ(foo_hws, foo_hws); ASSERT_NE(foo_hws, bar_hws); - entt::hashed_wstring hws{L"foobar"}; + const entt::hashed_wstring hws{L"foobar"}; ASSERT_EQ(static_cast(hws), expected_v); ASSERT_EQ(hws.value(), expected_v); @@ -160,7 +160,7 @@ TEST(HashedWString, Functionalities) { TEST(HashedWString, Empty) { using hash_type = entt::hashed_wstring::hash_type; - entt::hashed_wstring hws{}; + const entt::hashed_wstring hws{}; ASSERT_EQ(hws.size(), 0u); ASSERT_EQ(static_cast(hws), hash_type{}); @@ -169,7 +169,7 @@ TEST(HashedWString, Empty) { TEST(HashedWString, Correctness) { const wchar_t *foobar = L"foobar"; - std::wstring_view view{L"foobar__", 6}; + const std::wstring_view view{L"foobar__", 6}; ASSERT_EQ(entt::hashed_wstring{foobar}, expected_v); ASSERT_EQ((entt::hashed_wstring{view.data(), view.size()}), expected_v);