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 committed Sep 20, 2024
1 parent eb62fb3 commit d394981
Show file tree
Hide file tree
Showing 11 changed files with 347 additions and 347 deletions.
20 changes: 10 additions & 10 deletions tests/safe_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ TEST(safe_struct, basic) {
}
ASSERT_EQ(VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, safe_info.sType);
ASSERT_EQ(0, strcmp("test", safe_info.pApplicationInfo->pApplicationName));
ASSERT_EQ(42, safe_info.pApplicationInfo->applicationVersion);
ASSERT_EQ(42u, safe_info.pApplicationInfo->applicationVersion);

auto debug_ci = vku::FindStructInPNextChain<VkDebugUtilsMessengerCreateInfoEXT>(safe_info.pNext);
ASSERT_NE(nullptr, debug_ci);
ASSERT_EQ(VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, debug_ci->messageSeverity);
ASSERT_EQ(static_cast<VkDebugUtilsMessageSeverityFlagsEXT>(VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT), debug_ci->messageSeverity);
}

TEST(safe_struct, safe_void_pointer_copies) {
Expand Down Expand Up @@ -111,11 +111,11 @@ TEST(safe_struct, custom_safe_pnext_copy) {

auto safe_pri = reinterpret_cast<const vku::safe_VkPipelineRenderingCreateInfo *>(safe_gpci.pNext);
// Ensure original input struct was not modified
ASSERT_EQ(pri.colorAttachmentCount, 1);
ASSERT_EQ(pri.colorAttachmentCount, 1u);
ASSERT_EQ(pri.pColorAttachmentFormats, &format);

// Ensure safe struct was modified
ASSERT_EQ(safe_pri->colorAttachmentCount, 0);
ASSERT_EQ(safe_pri->colorAttachmentCount, 0u);
ASSERT_EQ(safe_pri->pColorAttachmentFormats, nullptr);
}

Expand All @@ -129,11 +129,11 @@ TEST(safe_struct, custom_safe_pnext_copy) {
auto safe_gpl_info = reinterpret_cast<const vku::safe_VkGraphicsPipelineLibraryCreateInfoEXT *>(safe_gpci.pNext);
auto safe_pri = reinterpret_cast<const vku::safe_VkPipelineRenderingCreateInfo *>(safe_gpl_info->pNext);
// Ensure original input struct was not modified
ASSERT_EQ(pri.colorAttachmentCount, 1);
ASSERT_EQ(pri.colorAttachmentCount, 1u);
ASSERT_EQ(pri.pColorAttachmentFormats, &format);

// Ensure safe struct was modified
ASSERT_EQ(safe_pri->colorAttachmentCount, 0);
ASSERT_EQ(safe_pri->colorAttachmentCount, 0u);
ASSERT_EQ(safe_pri->pColorAttachmentFormats, nullptr);
}

Expand All @@ -148,11 +148,11 @@ TEST(safe_struct, custom_safe_pnext_copy) {

auto safe_pri = reinterpret_cast<const vku::safe_VkPipelineRenderingCreateInfo *>(safe_gpci.pNext);
// Ensure original input struct was not modified
ASSERT_EQ(pri.colorAttachmentCount, 1);
ASSERT_EQ(pri.colorAttachmentCount, 1u);
ASSERT_EQ(pri.pColorAttachmentFormats, &format);

// Ensure safe struct was modified
ASSERT_EQ(safe_pri->colorAttachmentCount, 1);
ASSERT_EQ(safe_pri->colorAttachmentCount, 1u);
ASSERT_EQ(*safe_pri->pColorAttachmentFormats, format);
}
}
Expand All @@ -167,7 +167,7 @@ TEST(safe_struct, extension_add_remove) {
ci.enabledExtensionCount = static_cast<uint32_t>(extensions.size());

vku::safe_VkDeviceCreateInfo safe_ci(&ci);
ASSERT_EQ(3, vku::FindExtension(safe_ci, "VK_KHR_maintenance4"));
ASSERT_EQ(3u, vku::FindExtension(safe_ci, "VK_KHR_maintenance4"));
ASSERT_EQ(safe_ci.enabledExtensionCount, vku::FindExtension(safe_ci, "VK_KHR_maintenance0"));

ASSERT_EQ(false, vku::RemoveExtension(safe_ci, "VK_KHR_maintenance0"));
Expand All @@ -179,7 +179,7 @@ TEST(safe_struct, extension_add_remove) {
}
ASSERT_EQ(false, vku::RemoveExtension(safe_ci, "VK_KHR_maintenance0"));

ASSERT_EQ(0, safe_ci.enabledExtensionCount);
ASSERT_EQ(0u, safe_ci.enabledExtensionCount);
ASSERT_EQ(nullptr, safe_ci.ppEnabledExtensionNames);

for (const auto &ext : extensions) {
Expand Down
8 changes: 4 additions & 4 deletions tests/sparse_range_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ TEST(sparse_range_map, basic) {

auto iter = map.find(42);
ASSERT_NE(iter, map.end());
ASSERT_EQ(0, iter->first.begin);
ASSERT_EQ(100, iter->first.end);
ASSERT_EQ(0u, iter->first.begin);
ASSERT_EQ(100u, iter->first.end);
ASSERT_EQ("first", iter->second);

iter = map.find(501);
Expand All @@ -34,8 +34,8 @@ TEST(sparse_range_map, small) {

auto iter = map.find(4);
ASSERT_NE(iter, map.end());
ASSERT_EQ(0, iter->first.begin);
ASSERT_EQ(10, iter->first.end);
ASSERT_EQ(0u, iter->first.begin);
ASSERT_EQ(10u, iter->first.end);
ASSERT_EQ("first", iter->second);

iter = map.find(51);
Expand Down
6 changes: 3 additions & 3 deletions tests/struct_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ TEST(struct_helper, structure_type_matches) {
nullptr, static_cast<VkBufferCreateFlags>(VK_BUFFER_CREATE_SPARSE_BINDING_BIT), std::numeric_limits<uint64_t>::max(),
static_cast<VkBufferUsageFlags>(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT), VK_SHARING_MODE_EXCLUSIVE, 0U, nullptr);
ASSERT_EQ(VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, buffer_create_info.sType);
ASSERT_EQ(VK_BUFFER_CREATE_SPARSE_BINDING_BIT, buffer_create_info.flags);
ASSERT_EQ(static_cast<VkBufferCreateFlags>(VK_BUFFER_CREATE_SPARSE_BINDING_BIT), buffer_create_info.flags);
ASSERT_EQ(std::numeric_limits<uint64_t>::max(), buffer_create_info.size);
ASSERT_EQ(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, buffer_create_info.usage);
ASSERT_EQ(static_cast<VkBufferUsageFlags>(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT), buffer_create_info.usage);
ASSERT_EQ(VK_SHARING_MODE_EXCLUSIVE, buffer_create_info.sharingMode);
ASSERT_EQ(0, buffer_create_info.queueFamilyIndexCount);
ASSERT_EQ(0u, buffer_create_info.queueFamilyIndexCount);
ASSERT_EQ(nullptr, buffer_create_info.pQueueFamilyIndices);
}

Expand Down
120 changes: 60 additions & 60 deletions tests/test_formats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,22 @@ TEST(format_utils, vkuFormatIsStencilOnly) {
TEST(format_utils, vkuFormatDepthSize) {
for (auto [format, format_str] : magic_enum::enum_entries<VkFormat>()) {
if (std::string::npos != format_str.find("_D16")) {
EXPECT_EQ(vkuFormatDepthSize(format), 16);
EXPECT_EQ(vkuFormatDepthSize(format), 16u);
} else if (std::string::npos != format_str.find("_D24")) {
EXPECT_EQ(vkuFormatDepthSize(format), 24);
EXPECT_EQ(vkuFormatDepthSize(format), 24u);
} else if (std::string::npos != format_str.find("_D32")) {
EXPECT_EQ(vkuFormatDepthSize(format), 32);
EXPECT_EQ(vkuFormatDepthSize(format), 32u);
} else {
EXPECT_EQ(vkuFormatDepthSize(format), 0);
EXPECT_EQ(vkuFormatDepthSize(format), 0u);
}
}
}
TEST(format_utils, vkuFormatStencilSize) {
for (auto [format, format_str] : magic_enum::enum_entries<VkFormat>()) {
if (std::string::npos != format_str.find("_S8")) {
EXPECT_EQ(vkuFormatStencilSize(format), 8);
EXPECT_EQ(vkuFormatStencilSize(format), 8u);
} else {
EXPECT_EQ(vkuFormatStencilSize(format), 0);
EXPECT_EQ(vkuFormatStencilSize(format), 0u);
}
}
}
Expand Down Expand Up @@ -350,11 +350,11 @@ TEST(format_utils, vkuFormatIsSinglePlane_422) {
TEST(format_utils, vkuFormatPlaneCount) {
for (auto [format, format_str] : magic_enum::enum_entries<VkFormat>()) {
if (std::string::npos != format_str.find("2PLANE")) {
EXPECT_EQ(vkuFormatPlaneCount(format), 2);
EXPECT_EQ(vkuFormatPlaneCount(format), 2u);
} else if (std::string::npos != format_str.find("3PLANE")) {
EXPECT_EQ(vkuFormatPlaneCount(format), 3);
EXPECT_EQ(vkuFormatPlaneCount(format), 3u);
} else {
EXPECT_EQ(vkuFormatPlaneCount(format), 1);
EXPECT_EQ(vkuFormatPlaneCount(format), 1u);
}
}
}
Expand Down Expand Up @@ -385,31 +385,31 @@ TEST(format_utils, vkuFindMultiplaneCompatibleFormat) {
TEST(format_utils, vkuFindMultiplaneExtentDivisors) {
EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_0_BIT).width,
1);
1u);
EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_1_BIT).width,
2);
2u);
EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_2_BIT).width,
2);
2u);

EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_0_BIT).height,
1);
1u);
EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_1_BIT).height,
2);
2u);
EXPECT_EQ(
vkuFindMultiplaneExtentDivisors(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, VK_IMAGE_ASPECT_PLANE_2_BIT).height,
2);
2u);

EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT).width, 1);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT).width, 2);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT).width, 1);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT).width, 1u);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT).width, 2u);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT).width, 1u);

EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT).height, 1);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT).height, 1);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT).height, 1);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT).height, 1u);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT).height, 1u);
EXPECT_EQ(vkuFindMultiplaneExtentDivisors(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT).height, 1u);
}

TEST(format_utils, vkuFormatComponentCount) {
Expand All @@ -430,24 +430,24 @@ TEST(format_utils, vkuFormatTexelBlockExtent) {
for (auto format : formats) {
auto extent = vkuFormatTexelBlockExtent(format);
if (vkuFormatIsCompressed(format)) {
EXPECT_GT(extent.width, 1);
EXPECT_GT(extent.height, 1);
EXPECT_EQ(extent.depth, 1);
EXPECT_GT(extent.width, 1u);
EXPECT_GT(extent.height, 1u);
EXPECT_EQ(extent.depth, 1u);
} else if (format == VK_FORMAT_UNDEFINED) {
EXPECT_EQ(extent.width, 0);
EXPECT_EQ(extent.height, 0);
EXPECT_EQ(extent.depth, 0);
EXPECT_EQ(extent.width, 0u);
EXPECT_EQ(extent.height, 0u);
EXPECT_EQ(extent.depth, 0u);
continue;
} else {
EXPECT_EQ(extent.width, 1);
EXPECT_EQ(extent.height, 1);
EXPECT_EQ(extent.depth, 1);
EXPECT_EQ(extent.width, 1u);
EXPECT_EQ(extent.height, 1u);
EXPECT_EQ(extent.depth, 1u);
}
}
auto extent = vkuFormatTexelBlockExtent(static_cast<VkFormat>(10001));
EXPECT_EQ(extent.width, 0);
EXPECT_EQ(extent.height, 0);
EXPECT_EQ(extent.depth, 0);
EXPECT_EQ(extent.width, 0u);
EXPECT_EQ(extent.height, 0u);
EXPECT_EQ(extent.depth, 0u);
}
TEST(format_utils, vkuFormatCompatibilityClass) {
for (auto [format, format_str] : magic_enum::enum_entries<VkFormat>()) {
Expand Down Expand Up @@ -515,30 +515,30 @@ TEST(format_utils, vkuFormatElementIsTexel) {
}
}
TEST(format_utils, vkuFormatElementSizeWithAspect) {
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_NONE), 16);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_STENCIL_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_DEPTH_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_NONE), 16);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_0_BIT), 16);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_1_BIT), 16);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_2_BIT), 16);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_STENCIL_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_DEPTH_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_NONE), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT), 2);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT), 2);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT), 2);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_STENCIL_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_DEPTH_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_NONE), 4);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_STENCIL_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_DEPTH_BIT), 4);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_NONE), 5);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT), 1);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_DEPTH_BIT), 4);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_NONE), 1);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT), 1);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_DEPTH_BIT), 0);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_NONE), 16u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_STENCIL_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_DEPTH_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_NONE), 16u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_0_BIT), 16u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_1_BIT), 16u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_PLANE_2_BIT), 16u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_STENCIL_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_IMAGE_ASPECT_DEPTH_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_NONE), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_0_BIT), 2u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_1_BIT), 2u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_PLANE_2_BIT), 2u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_STENCIL_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, VK_IMAGE_ASPECT_DEPTH_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_NONE), 4u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_STENCIL_BIT), 0u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_DEPTH_BIT), 4u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_NONE), 5u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT), 1u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_DEPTH_BIT), 4u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_NONE), 1u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT), 1u);
EXPECT_EQ(vkuFormatElementSizeWithAspect(VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_DEPTH_BIT), 0u);
}
TEST(format_utils, vkuFormatTexelSizeWithAspect) {
EXPECT_EQ(vkuFormatTexelSizeWithAspect(VK_FORMAT_R64G64_SFLOAT, VK_IMAGE_ASPECT_NONE), 16);
Expand Down Expand Up @@ -649,12 +649,12 @@ struct magic_enum::customize::enum_range<VkImageAspectFlagBits> {
TEST(format_utils, vkuGetPlaneIndex) {
for (auto [aspect_flag, aspect_flag_str] : magic_enum::enum_entries<VkImageAspectFlagBits>()) {
if (std::string::npos != aspect_flag_str.find("_ASPECT_PLANE_0")) {
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 0);
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 0u);
} else if (std::string::npos != aspect_flag_str.find("_ASPECT_PLANE_1")) {
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 1);
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 1u);

} else if (std::string::npos != aspect_flag_str.find("_ASPECT_PLANE_2")) {
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 2);
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), 2u);
} else {
EXPECT_EQ(vkuGetPlaneIndex(aspect_flag), VKU_FORMAT_INVALID_INDEX);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ TEST(test_vk_dispatch_table, cpp_interface) {

vkuInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr);

ASSERT_EQ(instance_dispatch_table.GetInstanceProcAddr, local_vkGetInstanceProcAddr);
ASSERT_EQ(reinterpret_cast<PFN_vkVoidFunction>(instance_dispatch_table.GetInstanceProcAddr), reinterpret_cast<PFN_vkVoidFunction>(local_vkGetInstanceProcAddr));

VkDevice device{};

vkuInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr);

ASSERT_EQ(device_dispatch_table.GetDeviceProcAddr, local_vkGetDeviceProcAddr);
ASSERT_EQ(reinterpret_cast<PFN_vkVoidFunction>(device_dispatch_table.GetDeviceProcAddr), reinterpret_cast<PFN_vkVoidFunction>(local_vkGetDeviceProcAddr));
}
Loading

0 comments on commit d394981

Please sign in to comment.