Skip to content

Commit 0f16949

Browse files
arjo129azeey
andauthored
Adds a regression test for logplayback fix in gazebosim#2611 (gazebosim#2619)
* Adds a regression test for logplayback gazebosim/gazebo_test_cases#1640 This commit adds a really simple regression check to make sure we actually publish on the right topic. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * typo fix Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Make atomic Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> --------- Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
1 parent ca40c1d commit 0f16949

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/integration/log_system.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,18 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback))
774774
// Start server
775775
Server playServer(playServerConfig);
776776

777+
// Simulate a client
778+
gz::transport::Node node;
779+
std::atomic<std::size_t> numMsgs = 0;
780+
std::function<void(const msgs::SerializedStepMap &)> mockClient =
781+
[&](const msgs::SerializedStepMap &/*_res*/)
782+
{
783+
numMsgs++;
784+
};
785+
using namespace std::placeholders;
786+
EXPECT_TRUE(node.Subscribe(
787+
"/world/default/state", mockClient));
788+
777789
// Callback function for entities played back
778790
// Compare current pose being played back with the pose from the stateMsg
779791
test::Relay playbackPoseTester;
@@ -837,6 +849,9 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback))
837849
// checked in the playbackPoseTester
838850
playServer.Run(true, 500, false);
839851

852+
// The client should have received some messages.
853+
EXPECT_NE(numMsgs, 0);
854+
840855
// Count the total number of state messages in the log file
841856
int nTotal{0};
842857
for (auto it = batch.begin(); it != batch.end(); ++it, ++nTotal) { }

0 commit comments

Comments
 (0)