Resolve "fix build failures in unit tests on some systems"

Closes #3166 (closed).

Edited by Andrei Pavel

Merge request reports