fix tests compilation on MSVC

There are some changes needed to compile under MSVC and MinGW.