diff --git a/test/common/level_zero_mocks.cpp b/test/common/level_zero_mocks.cpp index 4fc566bb2..8d64ba859 100644 --- a/test/common/level_zero_mocks.cpp +++ b/test/common/level_zero_mocks.cpp @@ -21,6 +21,7 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices( ze_device_handle_t device, std::vector residentDevices, ze_context_handle_t context, ze_device_properties_t device_properties, ze_memory_allocation_properties_t memory_allocation_properties) { + umf_level_zero_memory_provider_params_handle_t params = nullptr; EXPECT_EQ(umfLevelZeroMemoryProviderParamsCreate(¶ms), UMF_RESULT_SUCCESS); @@ -31,10 +32,10 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices( EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetMemoryType( params, UMF_MEMORY_TYPE_DEVICE), UMF_RESULT_SUCCESS); - - EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetResidentDevices( - params, residentDevices.data(), residentDevices.size()), - UMF_RESULT_SUCCESS); + EXPECT_EQ( + umfLevelZeroMemoryProviderParamsSetResidentDevices( + params, residentDevices.data(), (uint32_t)residentDevices.size()), + UMF_RESULT_SUCCESS); // query min page size operation upon provider initialization EXPECT_CALL(*this, zeDeviceGetProperties(device, _)) diff --git a/test/pools/pool_residency.cpp b/test/pools/pool_residency.cpp index ba88076f3..26ed99e37 100644 --- a/test/pools/pool_residency.cpp +++ b/test/pools/pool_residency.cpp @@ -9,6 +9,13 @@ #include "pool.hpp" #include "gtest/gtest.h" +// On MSVC disable C6285 warning produced by gtest: +// ( || ) is always a non-zero constant. +// Did you intend to use the bitwise-and operator? +#ifdef _MSC_VER +#pragma warning(disable : 6285) +#endif + using namespace testing; class PoolResidencyTestFixture : public Test { @@ -53,6 +60,7 @@ TEST_F(PoolResidencyTestFixture, EXPECT_CALL(l0mock, zeMemAllocDevice(CONTEXT, _, _, _, OUR_DEVICE, _)) .WillOnce( DoAll(SetArgPointee<5>(POINTER_0), Return(ZE_RESULT_SUCCESS))); + EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_0, _, _)) .WillOnce(Return(ZE_RESULT_SUCCESS)); EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_1, _, _))