Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Mar 4, 2022
1 parent 65d25f6 commit 7cdf467
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/plugins/transport_scene_manager/TransportSceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ TransportSceneManager::TransportSceneManager()
/////////////////////////////////////////////////
TransportSceneManager::~TransportSceneManager()
{
if (this->dataPtr->initializeTransport.joinable())
this->dataPtr->initializeTransport.join();
}

/////////////////////////////////////////////////
Expand Down
11 changes: 10 additions & 1 deletion test/integration/transport_scene_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,24 @@ TEST(MinimalSceneTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
QCoreApplication::processEvents();
sleep++;
}
EXPECT_TRUE(sceneRequested);
EXPECT_LT(sleep, maxSleep);

auto scene = engine->SceneByName("banana");
ASSERT_NE(nullptr, scene);

auto root = scene->RootVisual();
ASSERT_NE(nullptr, root);

for (sleep = 0; root->ChildCount() < 2 && sleep < maxSleep; ++sleep)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
QCoreApplication::processEvents();
}
EXPECT_LT(sleep, maxSleep);

// Check scene is populated
EXPECT_EQ(2u, root->ChildCount());
ASSERT_EQ(2u, root->ChildCount());

// First child is user camera
auto camera = std::dynamic_pointer_cast<rendering::Camera>(
Expand Down

0 comments on commit 7cdf467

Please sign in to comment.