FIX: fixed some issues with subscribung and unsubscribing from topics

This commit is contained in:
Henry Winkel
2023-01-18 11:21:57 +01:00
parent f7d57ccbb8
commit 49bdb28535
7 changed files with 83 additions and 40 deletions

View File

@@ -34,14 +34,25 @@ SCENARIO("A test scenario","[keywords]")
{
GIVEN("Preliminaries")
{
int i = 40;
WHEN("doing something")
{
i = i + 2;
WHISPER::InternalUDPService service(1,WHISPER::SourceType::SIMCOMTROLER,8000,"127.0.0.255","127.0.0.1");
auto receiver = std::make_shared<WHISPER::threadSafeQueue<WHISPER::Message>>();
service.connect(receiver) ;
// service.subscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::TRACK]);
int i = 0;
WHEN("doing something")
{
LOG_S(INFO)<<"wating";
// std::this_thread::sleep_for(std::chrono::milliseconds(1000));
service.disconnect();
LOG_S(INFO)<<"closing";
THEN("expecting something to happen")
{
REQUIRE(i == 42 );
// service.unsubscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::TRACK]);
REQUIRE(receiver.unique() == true );
} // THEN
} // WHEN
} // GIVEN