fix crash in UnitTest.cpp on vs.
Merge pull request #4915 from Dhilan007/develop_crash

fix crash in UnitTest.cpp on vs.