FairMQ: Fix unit test on GCC 4.9

This commit is contained in:
Dennis Klein 2018-03-23 14:35:24 +01:00 committed by Mohammad Al-Turany
parent 697c440aa0
commit 727b76bb1d
2 changed files with 12 additions and 12 deletions

View File

@ -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()};

View File

@ -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";