Skip to content

Fix utests macos

Didier WECKMANN requested to merge fix-utests-macos into dev

This fixes the following unit tests:

  • fwJobsTest: The problem was visible on macOS, but other platforms maybe impacted. Testing if the future is valid before waiting did the trick. Also a wrong "+" with a char* and an integer which give also a crash in release, has been replaced with a proper string concatenation
  • fwGdcmIOTest: The hashing function boost::hash_combine() doesn't always use the same implementation across platforms (!!!). We now use a regular sha1 hashing, a bit slower, but safe
  • fwRenderOgreTest: Deleting the dummy RenderWindow with destroy() leads to a double delete crash when deleting ogre root node. Using the appropriate Ogre::RenderSystem::destroyRenderWindow() seems to fix the crash
  • fwThreadTest: Use a workaround to mitigate the callback cost in time computation. This is a workaround because either the test itself is false (and maybe undoable, as unpredictable), either we must change the implementation of TimerAsio to take into account the time taken by the callback. We may look again for https://git.ircad.fr/Sight/sight/tree/fix/TimerAsio, but it is clear this change will have side effect since some code may actually want to wait for the callback to perform before reseting the timer. I guess that playing a video with openCV did fail with the above merge request

Tests to perform:

  • Works on macOS Debug
  • Works on macOS Release
  • Works on Windows Debug
  • Works on Windows Release
  • Works on Linux Debug
  • Works on Linux Release

Related to https://git.ircad.fr/Sight/sight/issues/141

Edited by Emilie WERNERT

Merge request reports