Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
  • Loading branch information
caguero committed Feb 17, 2023
1 parent dcb5cbf commit 70e44a3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/cmd/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,16 @@ TEST(gzTest, TopicInfo)

while (!infoFound && retries++ < 10u)
{
output = custom_exec_str(gz + " topic -t /foo2 -i " + g_gzVersion);
std::cout << output.size() << std::endl;
infoFound = output.size() > 70u;
output = custom_exec_str(gz + " topic -t /foo -i " + g_gzVersion);
bool pubsFound = output.find("No publishers") == std::string::npos;
bool subsFound = output.find("No subscribers") == std::string::npos;
// We should have publishers info but no subscribers.
infoFound = pubsFound && !subsFound;
std::this_thread::sleep_for(std::chrono::milliseconds(300));
}

EXPECT_TRUE(infoFound) << "OUTPUT["
<< output << "] Size[" << output.size()
<< "]. Expected Size>70" << std::endl;
EXPECT_TRUE(infoFound);
EXPECT_TRUE(output.find("gz.msgs.Vector3d") != std::string::npos);
std::cout << output << std::endl;

// Wait for the child process to return.
testing::waitAndCleanupFork(pi);
Expand Down Expand Up @@ -211,13 +210,14 @@ TEST(gzTest, TopicInfoSub)
{
output = custom_exec_str(gz + " topic -i -t " + topic + " "
+ g_gzVersion);
infoFound = output.size() > 60u;
bool pubsFound = output.find("No publishers") == std::string::npos;
bool subsFound = output.find("No subscribers") == std::string::npos;
// We should have subscribers info but no publishers.
infoFound = !pubsFound && subsFound;
std::this_thread::sleep_for(std::chrono::milliseconds(300));
}

EXPECT_TRUE(infoFound) << "OUTPUT["
<< output << "] Size[" << output.size()
<< "]. Expected Size>60" << std::endl;
EXPECT_TRUE(infoFound);
EXPECT_TRUE(output.find("gz.msgs.") != std::string::npos);
}
}
Expand Down

0 comments on commit 70e44a3

Please sign in to comment.