Skip to content

Commit

Permalink
Make sure the deprecated kSdfScopeDelimiter still works (#1305)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
azeey authored Aug 1, 2023
1 parent 9fc8150 commit 57511b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ std::string JoinName(
const std::string &internal::SdfScopeDelimiter()
{
static const gz::utils::NeverDestroyed<std::string> delimiter{
std::string()};
kScopeDelimiter};
return delimiter.Access();
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/Types_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ TEST(Types, ErrorsOutputStream)
EXPECT_EQ(expected, output.str());
}

/////////////////////////////////////////////////
TEST(Types, SplitName)
{
{
Expand Down Expand Up @@ -159,6 +160,7 @@ TEST(Types, SplitName)
}
}

/////////////////////////////////////////////////
TEST(Types, JoinName)
{
{
Expand Down Expand Up @@ -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
}

0 comments on commit 57511b8

Please sign in to comment.