FIX: fixed some issues with subscribung and unsubscribing from topics
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user