Skip to content

Commit

Permalink
pubsub_test adapted to new, simple descgate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Mar 20, 2024
1 parent 5a6438f commit 7123bf4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ecal/tests/cpp/pubsub_test/src/pubsub_gettopics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ TEST(core_cpp_pubsub, GetTopics)
// create and check a few pub/sub entities
{
eCAL::SDataTypeInformation info_A1 { "typeA1" ,"", "descA1" };
eCAL::SDataTypeInformation info_A1_2{ "typeA1.2","", "descA1.2" };
//eCAL::SDataTypeInformation info_A1_2{ "typeA1.2","", "descA1.2" };
eCAL::SDataTypeInformation info_A2 { "typeA2" ,"", "descA2" };
eCAL::SDataTypeInformation info_A3 { "typeA3" ,"", "descA3" };

eCAL::SDataTypeInformation info_B1 { "typeB1" ,"", "descB1" };
eCAL::SDataTypeInformation info_B1_2{ "typeB1.2","", "descB1.2" };
//eCAL::SDataTypeInformation info_B1_2{ "typeB1.2","", "descB1.2" };
eCAL::SDataTypeInformation info_B2 { "typeB2" ,"", "descB2" };

// create 3 publisher
Expand All @@ -51,15 +51,15 @@ TEST(core_cpp_pubsub, GetTopics)

// create a missmatching publisher
// this should trigger a warning but not increase map size
eCAL::CPublisher pub12("A1", info_A1_2);
//eCAL::CPublisher pub12("A1", info_A1_2);

// create 2 subscriber
eCAL::CSubscriber sub1("B1", info_B1);
eCAL::CSubscriber sub2("B2", info_B2);

// create a missmatching subscriber
// this should trigger a warning but not increase map size
eCAL::CSubscriber sub12("B1", info_B1_2);
//eCAL::CSubscriber sub12("B1", info_B1_2);

// get all topics
eCAL::Util::GetTopics(topic_info_map);
Expand Down Expand Up @@ -110,19 +110,19 @@ TEST(core_cpp_pubsub, GetTopics)
eCAL::Util::GetTopics(topic_info_map);

// size should be 5 again (because of pub1.2 and sub1.2 should have replaced pub1 and sub1 attributes now)
EXPECT_EQ(topic_info_map.size(), 5);
//EXPECT_EQ(topic_info_map.size(), 5);

// check overwritten attributes
{
eCAL::SDataTypeInformation utils_topic_info;
eCAL::Util::GetTopicDataTypeInformation("A1", utils_topic_info);
EXPECT_EQ(utils_topic_info, info_A1_2);
}
{
eCAL::SDataTypeInformation utils_topic_info;
eCAL::Util::GetTopicDataTypeInformation("B1", utils_topic_info);
EXPECT_EQ(utils_topic_info, info_B1_2);
}
//{
// eCAL::SDataTypeInformation utils_topic_info;
// eCAL::Util::GetTopicDataTypeInformation("A1", utils_topic_info);
// EXPECT_EQ(utils_topic_info, info_A1_2);
//}
//{
// eCAL::SDataTypeInformation utils_topic_info;
// eCAL::Util::GetTopicDataTypeInformation("B1", utils_topic_info);
// EXPECT_EQ(utils_topic_info, info_B1_2);
//}
}

// let's unregister them
Expand Down

0 comments on commit 7123bf4

Please sign in to comment.