From 57511b8936aab788d074decddd549a9e87a771b9 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 1 Aug 2023 16:30:32 -0500 Subject: [PATCH] Make sure the deprecated kSdfScopeDelimiter still works (#1305) The deprecated kSdfScopeDelimiter was initialized to an empty string instead of ::. This PR makes sure kSdfScopeDelimiter and kScopeDelimiter represent the same string. Signed-off-by: Addisu Z. Taddese --- src/Types.cc | 2 +- src/Types_TEST.cc | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Types.cc b/src/Types.cc index 8c3ddb5e9..6e202b936 100644 --- a/src/Types.cc +++ b/src/Types.cc @@ -149,7 +149,7 @@ std::string JoinName( const std::string &internal::SdfScopeDelimiter() { static const gz::utils::NeverDestroyed delimiter{ - std::string()}; + kScopeDelimiter}; return delimiter.Access(); } } diff --git a/src/Types_TEST.cc b/src/Types_TEST.cc index 392dfb137..37b951739 100644 --- a/src/Types_TEST.cc +++ b/src/Types_TEST.cc @@ -120,6 +120,7 @@ TEST(Types, ErrorsOutputStream) EXPECT_EQ(expected, output.str()); } +///////////////////////////////////////////////// TEST(Types, SplitName) { { @@ -159,6 +160,7 @@ TEST(Types, SplitName) } } +///////////////////////////////////////////////// TEST(Types, JoinName) { { @@ -198,3 +200,11 @@ TEST(Types, JoinName) EXPECT_EQ(joinedName, ""); } } + +///////////////////////////////////////////////// +TEST(Types, ScopeDelimiters) +{ + GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + EXPECT_EQ(sdf::kScopeDelimiter, sdf::kSdfScopeDelimiter); + GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +}