Skip to content

Commit

Permalink
tests: Fix windows warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg authored and spencer-lunarg committed Sep 20, 2024
1 parent f0a4b6c commit e228ff2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/framework/ray_tracing_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void BuildGeometryInfoKHR::SetupBuild(bool is_on_device_build, bool use_ppGeomet
host_scratch_ = nullptr;
if (scratch_size > 0) {
assert(scratch_size < vvl::kU32Max);
host_scratch_ = std::make_shared<std::vector<uint8_t>>(static_cast<size_t>(scratch_size), 0);
host_scratch_ = std::make_shared<std::vector<uint8_t>>(static_cast<size_t>(scratch_size), uint8_t(0u));
}
vk_info_.scratchData.hostAddress = host_scratch_->data();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/render_pass_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ VkRenderPassCreateInfo2 RenderPass2SingleSubpass::GetCreateInfo() {
void RenderPass2SingleSubpass::AddAttachmentDescription(VkFormat format, VkImageLayout initialLayout, VkImageLayout finalLayout,
VkAttachmentLoadOp loadOp, VkAttachmentStoreOp storeOp) {
attachment_descriptions_.push_back(vku::InitStruct<VkAttachmentDescription2>(
nullptr, 0, format, VK_SAMPLE_COUNT_1_BIT, loadOp, storeOp, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
nullptr, 0u, format, VK_SAMPLE_COUNT_1_BIT, loadOp, storeOp, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_ATTACHMENT_STORE_OP_DONT_CARE, initialLayout, finalLayout));
}

void RenderPass2SingleSubpass::AddAttachmentDescription(VkFormat format, VkSampleCountFlagBits samples, VkImageLayout initialLayout,
VkImageLayout finalLayout) {
attachment_descriptions_.push_back(vku::InitStruct<VkAttachmentDescription2>(
nullptr, 0, format, samples, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_DONT_CARE,
nullptr, 0u, format, samples, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_DONT_CARE, initialLayout, finalLayout));
}

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/parent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ TEST_F(NegativeParent, PhysicalDevice_Display) {
{
uint32_t gpu_count = 0;
vk::EnumeratePhysicalDevices(instance2, &gpu_count, nullptr);
ASSERT_GT(gpu_count, 0);
ASSERT_GT(gpu_count, 0u);
std::vector<VkPhysicalDevice> physical_devices(gpu_count);
vk::EnumeratePhysicalDevices(instance2, &gpu_count, physical_devices.data());
instance2_gpu = physical_devices[0];
Expand Down Expand Up @@ -560,7 +560,7 @@ TEST_F(NegativeParent, PhysicalDevice_RegisterDisplayEvent) {
{
uint32_t gpu_count = 0;
vk::EnumeratePhysicalDevices(instance2, &gpu_count, nullptr);
ASSERT_GT(gpu_count, 0);
ASSERT_GT(gpu_count, 0u);
std::vector<VkPhysicalDevice> physical_devices(gpu_count);
vk::EnumeratePhysicalDevices(instance2, &gpu_count, physical_devices.data());
instance2_gpu = physical_devices[0];
Expand Down Expand Up @@ -599,7 +599,7 @@ TEST_F(NegativeParent, PhysicalDevice_DisplayMode) {
{
uint32_t gpu_count = 0;
vk::EnumeratePhysicalDevices(instance2, &gpu_count, nullptr);
ASSERT_GT(gpu_count, 0);
ASSERT_GT(gpu_count, 0u);
std::vector<VkPhysicalDevice> physical_devices(gpu_count);
vk::EnumeratePhysicalDevices(instance2, &gpu_count, physical_devices.data());
instance2_gpu = physical_devices[0];
Expand Down Expand Up @@ -779,7 +779,7 @@ TEST_F(NegativeParent, GetDescriptorSetLayoutSupport) {
vkt::Sampler sampler(*m_device, SafeSaneSamplerCreateInfo());
const VkDescriptorSetLayoutBinding binding{0, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler.handle()};
const VkDescriptorSetLayoutCreateFlags flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT;
const auto dslci = vku::InitStruct<VkDescriptorSetLayoutCreateInfo>(nullptr, flags, 1, &binding);
const auto dslci = vku::InitStruct<VkDescriptorSetLayoutCreateInfo>(nullptr, flags, 1u, &binding);
VkDescriptorSetLayoutSupport support = vku::InitStructHelper();
m_errorMonitor->SetDesiredError("UNASSIGNED-vkGetDescriptorSetLayoutSupport-pImmutableSamplers-device");
vk::GetDescriptorSetLayoutSupport(m_second_device->handle(), &dslci, &support);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ray_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3683,7 +3683,7 @@ TEST_F(NegativeRayTracing, HostBuildOverlappingScratchBuffers) {
constexpr size_t blas_count = 3;

std::vector<vkt::as::BuildGeometryInfoKHR> blas_vec;
auto scratch_data = std::make_shared<std::vector<uint8_t>>(1 << 15, 0);
auto scratch_data = std::make_shared<std::vector<uint8_t>>(1u << 15u, uint8_t(0));
for (size_t i = 0; i < blas_count; ++i) {
auto blas = vkt::as::blueprint::BuildGeometryInfoSimpleOnHostBottomLevel(*m_device);
blas.SetHostScratchBuffer(scratch_data);
Expand Down

0 comments on commit e228ff2

Please sign in to comment.