Skip to content

Commit ed78b06

Browse files
committed
Use recursive call in Blackboard::createEntry
1 parent 370133e commit ed78b06

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/blackboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void Blackboard::createEntry(const std::string& key, const TypeInfo& info)
143143
{
144144
if(StartWith(key, '@'))
145145
{
146-
rootBlackboard()->createEntryImpl(key.substr(1, key.size() - 1), info);
146+
rootBlackboard()->createEntry(key.substr(1, key.size() - 1), info);
147147
}
148148
else
149149
{

tests/gtest_blackboard.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,14 @@ TEST(BlackboardTest, TimestampedInterface)
654654
ASSERT_EQ(stamp_opt->seq, 2);
655655
ASSERT_GE(stamp_opt->time.count(), nsec_before);
656656
}
657+
658+
TEST(BlackboardTest, EmptyKeyTest)
659+
{
660+
auto bb = BT::Blackboard::create();
661+
bb->set("", 2);
662+
ASSERT_EQ(bb->get<int>(""), 2);
663+
bb->set("@@", 3);
664+
ASSERT_EQ(bb->get<int>("@@"), 3);
665+
ASSERT_EQ(bb->get<int>("@"), 3);
666+
ASSERT_EQ(bb->get<int>(""), 3);
667+
}

0 commit comments

Comments
 (0)