Skip to content

Commit

Permalink
tests: Test sync2 extension is found once
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Aug 24, 2023
1 parent ff5a645 commit da22040
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/synchronization2_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,3 +1435,24 @@ TEST_F(Sync2Test, SwapchainImage) {
vk::DestroyImageView(m_device->device(), view, NULL);
DestroySwapchain();
}

TEST_F(Sync2Test, EnumerateDeviceExtensionProperties) {
TEST_DESCRIPTION("Verify the extension is found only once");
if (!CheckSynchronization2SupportAndInitState()) {
GTEST_SKIP() << kSkipPrefix << " synchronization2 not supported, skipping test";
}

uint32_t propertyCount;
vk::EnumerateDeviceExtensionProperties(m_device->phy().handle(), nullptr, &propertyCount, nullptr);
std::vector<VkExtensionProperties> props(propertyCount);
vk::EnumerateDeviceExtensionProperties(m_device->phy().handle(), nullptr, &propertyCount, props.data());

uint32_t count = 0;
for (const auto &p : props) {
if (strcmp(p.extensionName, "VK_KHR_synchronization2") == 0) {
++count;
}
}

ASSERT_EQ(count, 1);
}

0 comments on commit da22040

Please sign in to comment.