mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
FairMQ: Fix unit test on GCC 4.9
This commit is contained in:
parent
697c440aa0
commit
727b76bb1d
|
@ -33,20 +33,20 @@ class PairLeft : public FairMQDevice
|
||||||
int counter{0};
|
int counter{0};
|
||||||
|
|
||||||
// Simple empty message ping pong
|
// Simple empty message ping pong
|
||||||
auto msg1{NewMessageFor("data", 0)};
|
auto msg1(NewMessageFor("data", 0));
|
||||||
if (Send(msg1, "data") >= 0) counter++;
|
if (Send(msg1, "data") >= 0) counter++;
|
||||||
auto msg2{NewMessageFor("data", 0)};
|
auto msg2(NewMessageFor("data", 0));
|
||||||
if (Receive(msg2, "data") >= 0) counter++;
|
if (Receive(msg2, "data") >= 0) counter++;
|
||||||
auto msg3{NewMessageFor("data", 0)};
|
auto msg3(NewMessageFor("data", 0));
|
||||||
if (Send(msg3, "data") >= 0) counter++;
|
if (Send(msg3, "data") >= 0) counter++;
|
||||||
auto msg4{NewMessageFor("data", 0)};
|
auto msg4(NewMessageFor("data", 0));
|
||||||
if (Receive(msg4, "data") >= 0) counter++;
|
if (Receive(msg4, "data") >= 0) counter++;
|
||||||
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
||||||
|
|
||||||
// Simple message with short text data
|
// Simple message with short text data
|
||||||
auto msg5{NewSimpleMessageFor("data", 0, "testdata1234")};
|
auto msg5(NewSimpleMessageFor("data", 0, "testdata1234"));
|
||||||
if (Send(msg5, "data") >= 0) counter++;
|
if (Send(msg5, "data") >= 0) counter++;
|
||||||
auto msg6{NewMessageFor("data", 0)};
|
auto msg6(NewMessageFor("data", 0));
|
||||||
auto ret = Receive(msg6, "data");
|
auto ret = Receive(msg6, "data");
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
auto content = std::string{static_cast<char*>(msg6->GetData()), msg6->GetSize()};
|
auto content = std::string{static_cast<char*>(msg6->GetData()), msg6->GetSize()};
|
||||||
|
|
|
@ -34,25 +34,25 @@ class PairRight : public FairMQDevice
|
||||||
int counter{0};
|
int counter{0};
|
||||||
|
|
||||||
// Simple empty message ping pong
|
// Simple empty message ping pong
|
||||||
auto msg1{NewMessageFor("data", 0)};
|
auto msg1(NewMessageFor("data", 0));
|
||||||
if (Receive(msg1, "data") >= 0) counter++;
|
if (Receive(msg1, "data") >= 0) counter++;
|
||||||
auto msg2{NewMessageFor("data", 0)};
|
auto msg2(NewMessageFor("data", 0));
|
||||||
if (Send(msg2, "data") >= 0) counter++;
|
if (Send(msg2, "data") >= 0) counter++;
|
||||||
auto msg3{NewMessageFor("data", 0)};
|
auto msg3(NewMessageFor("data", 0));
|
||||||
if (Receive(msg3, "data") >= 0) counter++;
|
if (Receive(msg3, "data") >= 0) counter++;
|
||||||
auto msg4{NewMessageFor("data", 0)};
|
auto msg4(NewMessageFor("data", 0));
|
||||||
if (Send(msg4, "data") >= 0) counter++;
|
if (Send(msg4, "data") >= 0) counter++;
|
||||||
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
||||||
|
|
||||||
// Simple message with short text data
|
// Simple message with short text data
|
||||||
auto msg5{NewMessageFor("data", 0)};
|
auto msg5(NewMessageFor("data", 0));
|
||||||
auto ret = Receive(msg5, "data");
|
auto ret = Receive(msg5, "data");
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
|
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
|
||||||
LOG(info) << ret << ", " << msg5->GetSize() << ", '" << content << "'";
|
LOG(info) << ret << ", " << msg5->GetSize() << ", '" << content << "'";
|
||||||
if (msg5->GetSize() == ret && content == "testdata1234") counter++;
|
if (msg5->GetSize() == ret && content == "testdata1234") counter++;
|
||||||
}
|
}
|
||||||
auto msg6{NewSimpleMessageFor("data", 0, "testdata1234")};
|
auto msg6(NewSimpleMessageFor("data", 0, "testdata1234"));
|
||||||
if (Send(msg6, "data") >= 0) counter++;
|
if (Send(msg6, "data") >= 0) counter++;
|
||||||
if (counter == 6) LOG(info) << "Simple message with short text data successfull";
|
if (counter == 6) LOG(info) << "Simple message with short text data successfull";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user